Code tool

Escape JSON

Convert JSON safely in your browser. Choose a complete JSON value or a quoted string literal so escaping rules and errors match the data you are handling.

In-browser processingNo account requiredPrivacy details ↗

Maximum 100,000 characters. Processing stays in your browser.

A value may be an object, array, number, boolean, or null. A literal must be a quoted JSON string.

A QUICK WALKTHROUGH

How to use this tool

  1. Choose Escape JSON or Unescape JSON, then select JSON value or JSON string literal.
  2. Paste valid input and submit to validate the exact syntax and escape sequences.
  3. Review the result, then copy it or download a JSON file.

Values and literals are different inputs

JSON value mode accepts an object, array, string, number, boolean, or null and validates the complete document. JSON string literal mode requires one JSON quoted string, such as "hello\nworld"; it rejects objects and unquoted text so the boundary stays explicit.

Visible JSON error boundaries

Malformed JSON, trailing commas, unescaped control characters, invalid escape sequences, and extra content are rejected with the browser parser message. Processing, copying, and download preparation happen locally without a backend.

GOOD TO KNOW

Common questions

What is a JSON string literal?

It is one quoted JSON string including its surrounding double quotes, for example "hello\nworld". A plain sentence without quotes is not a JSON string literal.

Can value mode handle arrays and numbers?

Yes. It accepts every JSON root type, including objects, arrays, strings, numbers, booleans, and null.

Does this upload my JSON?

No. Parsing and conversion run in your browser.