diff --git a/src/mol-util/uuid.ts b/src/mol-util/uuid.ts
index 983d88663c1d4a0a54d1ec54e8d1c24c3d321714..fd96f6e1ec124a6c65c1bc29964d21709f3ef221 100644
--- a/src/mol-util/uuid.ts
+++ b/src/mol-util/uuid.ts
@@ -16,7 +16,7 @@ namespace UUID {
             chars[i] = String.fromCharCode((d + Math.random()*0xff)%0xff | 0);
             d = Math.floor(d/0xff);
         }
-        return btoa(chars.join('')).substr(0, 22) as UUID;
+        return btoa(chars.join('')).replace(/\+/g, '-').replace(/\//g, '_').substr(0, 22) as UUID;
         // const uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
         //     const r = (d + Math.random()*16)%16 | 0;
         //     d = Math.floor(d/16);