JSON escape
Escape text for use inside a JSON string: quotes, backslashes, tabs and line breaks become \", \\, \t and \n.
Runs in your browserNothing uploadedWorks offline
Set up for this job. It runs on String escape and unescape, where every option is there to change.
Loading JSON escapeRuns on this device. Nothing is uploaded.
Questions
Are the surrounding quotes added?
No. You get the inside of the string, so you can paste it between the quotes you already have.
What about accents and emoji?
They are left as they are, which JSON allows. Tick Escape non-ASCII to write them as \u escapes instead, for systems that only accept ASCII.
How do I go the other way?
Open JSON unescape, or switch Direction to Unescape on this page.
Related tools
All developer toolsDeveloperString escape and unescapeEscape or unescape a string for JSON, JavaScript, HTML, URLs, CSV or regular expressions, with clear errors for broken escapes.DeveloperBase64 encode and decodeEncode text or any file to Base64 and decode Base64 back to text or the original file, with a URL-safe option.DeveloperBinary to decimalConvert binary numbers of any length to decimal, with hex and octal shown too, exactly and as you type.Developerapplication image videoChecksum verifierDrop a file and paste the published checksum to see if it matches. MD5, SHA-1, SHA-256, SHA-384, SHA-512 and CRC32 are detected for you.DeveloperChmod calculatorTick read, write and execute boxes or type 755 or rwxr-xr-x, and get the matching octal, symbolic and chmod command, explained.DeveloperCIDR and subnet calculatorType an IP with a prefix or mask to get the network, broadcast, host range, host count, netmask and wildcard. IPv6 works too.