0 lines
Drop file to load
Clean JSON
 

Everything runs in your browser. Your data is never uploaded to Flipper File.

Remove Backslashes from JSON

Paste escaped JSON, like {\"name\":\"Ana\"} from a log file or a JSON string that was encoded twice, and get clean, readable JSON as you type. Instead of blindly deleting every backslash, this tool undoes the escaping properly, one layer at a time, so the result is valid JSON you can use right away.

How to use it

  1. Paste the escaped JSON into the box on the left, or load a .json, .txt, or .log file.
  2. The clean JSON appears on the right as you type. The bar under it shows how many layers of escaping were removed and whether the result is valid JSON.
  3. Choose an indent size, or Minified for a single line.
  4. Click Copy or Download. Use Use as input if you want to keep working on the result.

Why JSON ends up full of backslashes

When JSON is saved as text inside something else, like a log line, a database column, a message queue, or another JSON document, its quotes have to be escaped as \". Each extra round of encoding adds another layer, so " becomes \", then \\\", and so on. For example, this API response:

"{\"user\":{\"id\":42,\"name\":\"Ana Ruiz\"},\"note\":\"Line one\\nLine two\"}"

becomes:

{
  "user": {
    "id": 42,
    "name": "Ana Ruiz"
  },
  "note": "Line one\nLine two"
}

What Smart unescape does

  • If the input is a quoted JSON string, it's decoded, and that repeats until the result is real JSON, however many layers deep it goes.
  • Escaped text without outer quotes, like {\"id\":1}, is unescaped too.
  • Escape codes like \u00e1 become the actual characters, like á.
  • Single quotes around the whole input, common when JSON is copied from a terminal command, are removed.

If the result still isn't valid JSON, the tool says so and points to the line and column of the first problem.

JSON stored inside a string

APIs and webhooks often put JSON inside a string field, like "payload": "{\"event\":\"signup\"}". With Unpack JSON inside strings on, those fields are turned into real nested objects, and a note lists which fields were unpacked. Turn it off to keep them as strings.

Backslashes that should stay

Some backslashes are part of valid JSON. A quote inside a string value has to be written as \", and a backslash as \\. If you paste JSON that's already valid, the tool formats it and keeps those, and lets you know that's why they're still there.

When to use Remove every backslash

For text that isn't JSON at all, where the backslashes are just clutter, switch the mode to Remove every backslash. It deletes every one, without trying to interpret them. Don't use it on real JSON, since removing required backslashes can break the JSON.

Frequently asked questions

Is my data uploaded anywhere?

No. Everything happens in your browser, so it's safe to use with API keys, tokens, and private data.

Why does my result still have some backslashes?

Those are inside string values, where JSON requires them. A quote inside a string must stay escaped as \", or the JSON would break.

What does ASCII-only output do?

It writes every character outside basic ASCII as a \u code, so é becomes \u00e9. Use it when the JSON is headed somewhere that can't handle other characters.

Can it fix other JSON errors, like missing commas?

It doesn't change your data, but when the result isn't valid JSON, it shows exactly where the problem is so you can fix it.

Can I clean a whole file?

Yes. Load or drop a .json, .txt, or .log file up to 25 MB, then download the cleaned version.

Our Full Dev Tool Library

Flipper File