Skip to content
TabKiwiTabKiwi

JSON Escape

Turn any text into a valid JSON string literal, with quotes, newlines and backslashes escaped.

DeveloperRuns in your browser. Your files never leave this device.
Loading tool…

About this tool

Pasting multi-line text, code or Windows paths straight into a JSON file breaks it. This tool escapes quotes, backslashes, tabs, line breaks and control characters exactly the way JSON.stringify does, so the result can be dropped into a JSON document or a JavaScript string. You can leave off the surrounding quotes and escape non-ASCII characters as \u codes. It works offline in your browser.

How to use JSON Escape

  1. Paste the raw text.
  2. Choose whether to wrap it in quotes.
  3. Optionally escape non-ASCII characters.
  4. Copy the JSON string.

Frequently asked questions

Which characters get escaped?

Double quotes, backslashes and control characters such as newline and tab. Forward slashes do not need escaping in JSON.

Why escape non-ASCII?

Some older parsers and transport layers mishandle UTF-8. Pure ASCII output with \u escapes avoids that.

More Developer tools

View all 91 →