How to use this tool
- Enter text or quoted json string, action.
- Select Update result to view the result.
- 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.
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.