Text utilities

JSON String Escape and Unescape

Encode plain text as one valid JSON string, or decode a quoted JSON string back into text.

Text stays in your browserCopy your result
Data workspace
Data workspace

Check delimiters and structure before downloading the output.

See the method

Your source data

Runs on your device

Your transformed data

Your result

Let’s calculate.

Use the Calculate button to see your result.

Your content is processed locally.

How to use this tool

  1. Enter text or quoted json string, action.
  2. Select Update result to view the result.
  3. Check the method and assumptions below before using the result.

The method, explained

Encoding applies JSON.stringify to the entire input string. Decoding applies JSON.parse and accepts only a string value, rejecting objects, arrays and numbers.

A WORKED EXAMPLE

Using text or quoted json string = Hello "world" Second line, action = encode, the result is "Hello \"world\"\nSecond line". Change these example inputs to match your task; use the method above to check each step.

Understanding your result

A formatter works on a complete JSON document. This tool handles one string value and its quotes, newlines, backslashes and escape sequences.

What to keep in mind

This is JSON string escaping, not HTML escaping. Empty decoded strings are valid results.

Common questions

How is this different from JSON formatting?

A formatter works on a complete JSON document. This tool handles one string value and its quotes, newlines, backslashes and escape sequences.

Does my text leave my device?

Processing runs locally in this browser. Your pasted text is not uploaded to an API or stored in a ClarityKit account.

Methodology maintained by ClarityKit. How these tools are built and checked.