diff --git a/js/modules/privacy.js b/js/modules/privacy.js
index 50a93dd9b..d737f5d05 100644
--- a/js/modules/privacy.js
+++ b/js/modules/privacy.js
@@ -73,7 +73,7 @@ exports.redactGroupIds = text => {
   return text.replace(
     GROUP_ID_PATTERN,
     (match, before, id, after) =>
-      `${before}${REDACTION_PLACEHOLDER}${id.slice(-3)}${after}`
+      `${before}${REDACTION_PLACEHOLDER}${removeNewlines(id).slice(-3)}${after}`
   );
 };
 
@@ -86,3 +86,5 @@ exports.redactAll = compose(
   exports.redactGroupIds,
   exports.redactPhoneNumbers
 );
+
+const removeNewlines = text => text.replace(/\r?\n|\r/g, '');
diff --git a/test/modules/privacy_test.js b/test/modules/privacy_test.js
index f9f4f71d9..1c983ef13 100644
--- a/test/modules/privacy_test.js
+++ b/test/modules/privacy_test.js
@@ -33,6 +33,18 @@ describe('Privacy', () => {
         'and group([REDACTED]hij)';
       assert.equal(actual, expected);
     });
+
+    it('should remove newlines from redacted group IDs', () => {
+      const text =
+        'This is a log line with two group IDs: group(12345678\n9)\n' +
+        'and group(abc\ndefghij)';
+
+      const actual = Privacy.redactGroupIds(text);
+      const expected =
+        'This is a log line with two group IDs: group([REDACTED]789)\n' +
+        'and group([REDACTED]hij)';
+      assert.equal(actual, expected);
+    });
   });
 
   describe('redactAll', () => {