JustRandom

JSON Escape / Unescape

Encode raw text as a JSON string literal or decode one back to text.

Escape or unescape a JSON string

Encode raw text as one complete JSON string literal, or decode a literal back to its exact text.

Mode

Empty text is valid. The result includes surrounding quotation marks.

Escaped JSON string

The transformed result will appear here.

How to escape or unescape text

  1. Choose Escape for raw text or Unescape for a JSON string literal.
  2. Enter the complete source value in the labeled field.
  3. Run the matching action, then copy the exact result.

Escape example

Two raw lines containing a quoted name:

Hello
"JustRandom"

Become "Hello\n\"JustRandom\"", including the surrounding quotation marks.

JSON string semantics

Escape mode uses JSON string serialization. Unescape mode parses JSON and accepts only a string root, rejecting objects, arrays, numbers, booleans, null, and invalid escape sequences. Unicode remains ordinary readable text unless JSON syntax requires an escape.

Privacy and limitations

Your input and results are processed in this browser and are not uploaded by this tool or saved between sessions. Escaping is a syntax transformation, not validation for a surrounding document and not a security control.

Frequently asked questions

Does escaping encrypt text?

No. Escaping only represents text safely as JSON syntax; it provides no secrecy or encryption.

Why must unescape input include quotation marks?

The tool accepts a complete JSON string literal, so surrounding quotation marks are part of the required JSON syntax.

Can it decode an empty string?

Yes. The literal "" successfully decodes to an empty text result that can still be copied.

Related tools

Explore another available JustRandom tool that may help with a related task.