would otherwise end the block." } }, { "@type": "Question", "name": "Are raw line breaks allowed inside a JSON string?", "acceptedAnswer": { "@type": "Answer", "text": "No, JSON.parse rejects them. By default this tool accepts them when unescaping because pasted text often has them, and strict mode rejects them like the standard does." } }, { "@type": "Question", "name": "Can it pretty-print the result?", "acceptedAnswer": { "@type": "Answer", "text": "Yes. When the unescaped text is a JSON object or array, the pretty-print option formats it, which helps with payloads stored as escaped strings in logs or databases." } }, { "@type": "Question", "name": "Is my text uploaded?", "acceptedAnswer": { "@type": "Answer", "text": "No. Escaping and unescaping run in your browser and no request containing your text is made." } } ], "faqs": [ { "@type": "Question", "name": "How do I escape a string for JSON?", "acceptedAnswer": { "@type": "Answer", "text": "Paste the text on the Escape tab. Quotes, backslashes, line breaks, tabs and other control characters are replaced by their backslash sequences, giving the same result as JSON.stringify without the outer quotes." } }, { "@type": "Question", "name": "Which characters must be escaped in a JSON string?", "acceptedAnswer": { "@type": "Answer", "text": "The double quote, the backslash and all control characters below U+0020, such as line feed and tab. Everything else, including accents and emoji, may appear as it is." } }, { "@type": "Question", "name": "How do I unescape a JSON string?", "acceptedAnswer": { "@type": "Answer", "text": "Switch to the Unescape tab and paste the text, with or without its surrounding quotes. Sequences like \\n, \\\" and \\u00e9 are turned back into real characters." } }, { "@type": "Question", "name": "How are Unicode characters and emoji handled?", "acceptedAnswer": { "@type": "Answer", "text": "With the non-ASCII option on, each character above U+007F becomes \\uXXXX. Emoji outside the basic plane become two escapes, a surrogate pair such as \\ud83d\\ude00, and are joined again when unescaping." } }, { "@type": "Question", "name": "What is double-escaped JSON?", "acceptedAnswer": { "@type": "Answer", "text": "JSON that was escaped twice, so you see \\\\\\\" instead of \\\". Choose 2 or 3 layers in the Unescape tab to remove them one at a time. The tool stops and says so when the text is no longer an escaped string." } }, { "@type": "Question", "name": "Why does it report an invalid escape sequence?", "acceptedAnswer": { "@type": "Answer", "text": "JSON allows only \\\" \\\\ \\/ \\b \\f \\n \\r \\t and \\uXXXX. Sequences such as \\x41 or \\' are not valid, and the error shows the line and column of the first one." } }, { "@type": "Question", "name": "Should I escape the forward slash?", "acceptedAnswer": { "@type": "Answer", "text": "It is optional in JSON. Escaping it as \\/ helps when JSON is embedded in an HTML script block, where would otherwise end the block." } }, { "@type": "Question", "name": "Are raw line breaks allowed inside a JSON string?", "acceptedAnswer": { "@type": "Answer", "text": "No, JSON.parse rejects them. By default this tool accepts them when unescaping because pasted text often has them, and strict mode rejects them like the standard does." } }, { "@type": "Question", "name": "Can it pretty-print the result?", "acceptedAnswer": { "@type": "Answer", "text": "Yes. When the unescaped text is a JSON object or array, the pretty-print option formats it, which helps with payloads stored as escaped strings in logs or databases." } }, { "@type": "Question", "name": "Is my text uploaded?", "acceptedAnswer": { "@type": "Answer", "text": "No. Escaping and unescaping run in your browser and no request containing your text is made." } } ] }