---
title: "JSON Unescape and Escape: Every Layer at Once"
description: "Free JSON unescape and escape: undo double or triple escaping in one paste, open stringified fields like tool-call arguments, see bad escapes by line."
canonical: "https://browser-use.com/tools/json-unescape"
last_updated: "2026-11-18"
---

# JSON Unescape and Escape: Every Layer at Once

## JSON Unescape and Escape

Unescape JSON in your browser. Every escape layer is undone in one paste, and string fields that hold JSON, like tool-call arguments, open into objects.

## How it works

### Paste it

Paste escaped JSON, a log line or a file up to 100 MB. Quotes around it are optional. Nothing is uploaded.

### Read the layers

Every layer is undone at once and counted. Fields that hold JSON open into objects; turn that off to keep them as strings.

### Or escape

Switch to Escape to turn text or JSON into a JSON string, once or up to 10 times.

### Which escapes are valid in JSON?

\\" \\\\ \\/ \\b \\f \\n \\r \\t and \\u with 4 hex digits, upper or lower case. Anything else, like \\x41, \\a or \\', is an error, shown with its line and column.

Source: [RFC 8259 §7](https://www.rfc-editor.org/rfc/rfc8259#section-7)

### What is double escaped JSON?

JSON saved as a string inside other JSON: "{\\"a\\":1}" holds {"a":1}. A string escapes its quotes and backslashes, so each time adds a layer of backslashes. All layers are undone and counted; JSON with none counts as 0.

Source: [RFC 8259 §7](https://www.rfc-editor.org/rfc/rfc8259#section-7)

### Why do big numbers stay exact?

JSON.parse reads numbers as JavaScript numbers, exact only up to 9007199254740991, so 12345678901234567890 becomes 12345678901234567000. Here every number keeps the digits it was written with.

Source: [MDN: MAX\_SAFE\_INTEGER](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER) · [RFC 8259 §6](https://www.rfc-editor.org/rfc/rfc8259#section-6)

### What about duplicate keys?

JSON says keys should be unique, and JSON.parse keeps only the last. Here all of them are kept, as written, and each one is listed. A \_\_proto\_\_ key is a plain key.

Source: [RFC 8259 §4](https://www.rfc-editor.org/rfc/rfc8259#section-4)

### What does Safe inside a script tag do?

It writes < as \\u003c, so the text cannot close the script tag early, and U+2028 and U+2029 as escapes, which JavaScript strings did not allow before ES2019.

Source: [HTML: script contents](https://html.spec.whatwg.org/multipage/scripting.html#restrictions-for-contents-of-script-elements) · [TC39 JSON superset](https://github.com/tc39/proposal-json-superset)

## Debugging what an agent did?

Browser Use agents open pages in a real browser, including dynamic ones, and return structured data.

[See AI web scraping](https://browser-use.com/web-scraping)

1 layer undone

Mode

UnescapeEscape

Escaped JSON or text"{\\"Type\\":\\"Notification\\",\\"MessageId\\":\\"6f9b2c1e\\",\\"Message\\":\\"{\\\\\\"id\\\\\\":\\\\\\"chatcmpl-123\\\\\\",\\\\\\"tool\_calls\\\\\\":\[{\\\\\\"id\\\\\\":\\\\\\"call\_abc\\\\\\",\\\\\\"type\\\\\\":\\\\\\"function\\\\\\",\\\\\\"function\\\\\\":{\\\\\\"name\\\\\\":\\\\\\"get\_weather\\\\\\",\\\\\\"arguments\\\\\\":\\\\\\"{\\\\\\\\\\\\\\"city\\\\\\\\\\\\\\":\\\\\\\\\\\\\\"Paris\\\\\\\\\\\\\\",\\\\\\\\\\\\\\"units\\\\\\\\\\\\\\":\\\\\\\\\\\\\\"metric\\\\\\\\\\\\\\"}\\\\\\"}}\]}\\"}"

Load exampleOpen file

Runs in your browser, files up to 100 MB. Nothing is uploaded.

Open JSON inside strings

String fields that hold a JSON object or array, like tool-call arguments, an SNS Message or an API Gateway body. Numbers and other text stay strings.

Indent

2 spaces4 spacesOne line

Every layer is undone in one pass. Escapes follow [RFC 8259](https://www.rfc-editor.org/rfc/rfc8259#section-7); a bad one is shown with its line and column. Big numbers keep every digit.

## JSON · 1 layer undone · 2 strings opened · 358 B

CopyDownload .json

2 string fields opened into JSON

-   $.Message
-   $.Message.tool\_calls\[0\].function.arguments

{
  "Type": "Notification",
  "MessageId": "6f9b2c1e",
  "Message": {
    "id": "chatcmpl-123",
    "tool\_calls": \[
      {
        "id": "call\_abc",
        "type": "function",
        "function": {
          "name": "get\_weather",
          "arguments": {
            "city": "Paris",
            "units": "metric"
          }
        }
      }
    \]
  }
}

---

BROWSER USE

- Browser Use Agents: give Browser Use a task and receive completed work. API V4 is current for new integrations.
- Browser Infrastructure: connect your agent or automation to managed browsers through SDK, REST, or CDP. Starts at $0.06/browser-hour.
- Developer tools: Open Source, Browser Harness, SDK, and MCP support the two products above.

[Developer Index](https://browser-use.com/index.md)
[Product Map](https://browser-use.com/llms.txt)
[Full Product Context](https://browser-use.com/llms-full.txt)
[Pricing](https://browser-use.com/pricing.md)
[Cloud Docs](https://docs.browser-use.com/cloud/quickstart)
[Open Source Docs](https://docs.browser-use.com/open-source/introduction)
