JSON error reference

Invalid escape character in JSON string

A backslash inside a JSON string must begin a supported escape sequence.

01

Why it happens

  • Windows paths with single backslashes
  • Regular expressions copied directly
  • An unsupported escape such as \q
  • A trailing backslash before the closing quote
02

Guide

Invalid
{
  "path": "C:\reports\new"
}
Valid
{
  "path": "C:\\reports\\new"
}
03

Common parser messages

Bad escaped characterInvalid escapeInvalid \escape
04

How to fix it

  1. 1

    Escape literal backslashes as double backslashes.

  2. 2

    Use supported escapes such as \n, \t, \\", \\, or \uXXXX.

  3. 3

    Check copied paths and regular expressions.

  4. 4

    Validate after editing only the affected string.

Jump to tool

Open broken example in JSON Repair

JSON Repair Tool