{/}
Tagbrace

JSON & XML Formatter, Validator & Converter

Runs in your browser — nothing is uploaded
Input empty
1
Waiting for input0 lines · 0 B
Output —
—

Free online JSON & XML formatter, validator and converter

Tagbrace is a fast, private tool for developers working with APIs, configuration files and data feeds. Paste or drop a file to beautify or minify it, validate it with exact line and column errors, or convert JSON to XML and XML to JSON in one click. Everything runs in your browser, so your data is never uploaded to a server.

{ } beautify

JSON formatter & beautifier

Pretty-print JSON with 2 spaces, 4 spaces or tabs and syntax highlighting. Large numbers and escape sequences are kept exactly as written.

</> beautify

XML formatter & beautifier

Indent XML cleanly while keeping attributes, namespaces, comments, CDATA sections, processing instructions and the XML declaration.

✓ validate

JSON & XML validator

Check that JSON is valid and XML is well-formed as you type. Errors show the exact line and column with a plain-English explanation.

{ } → </>

JSON to XML converter

Turn JSON objects and arrays into well-formed XML. Use @name keys for attributes and #text for element text.

</> → { }

XML to JSON converter

Turn XML into clean JSON. Repeated tags become arrays, and numbers and booleans can be detected automatically.

− minify

JSON & XML minifier

Strip whitespace to shrink payloads for APIs, storage and network transfer, and see how many bytes you saved.

How to use Tagbrace

  1. Add your data. Paste JSON or XML into the input pane, upload a file, or drag and drop it. The format is detected automatically.
  2. Choose an action. Click Beautify, Minify, Validate, JSON → XML or XML → JSON.
  3. Fix any errors. Invalid input is flagged with the line and column. Click the error to jump straight to it.
  4. Use the result. Copy the output, download it, or move it back into the input to keep working.

Keyboard shortcuts: Ctrl/⌘ + Enter to beautify, Ctrl/⌘ + Shift + Enter to minify.

Private by design

Many online formatters send your data to a server. Tagbrace doesn’t: parsing, formatting and conversion all run locally in your browser with JavaScript. That makes it safe for API responses, tokens, customer records and internal configuration.

Because no server processing is involved, it is also fast — even with files of several megabytes.

New to the formats? Read JSON vs XML, common JSON errors and how to fix XML errors.

How JSON ↔ XML conversion works

JSON and XML model data differently, so Tagbrace uses a simple, widely used convention that lets you convert in both directions without losing information.

XMLJSON
Element <name>Asha</name>"name": "Asha"
Attribute id="7""@id": "7"
Text next to child elements"#text": "…"
Repeated elements <tag>…</tag><tag>…</tag>Array "tag": [ … ]
Empty element <note/>"note": null

XML

<book id="bk101">
  <title>Clean Code</title>
  <author>Robert C. Martin</author>
  <price currency="USD">34.99</price>
</book>

JSON

{
  "book": {
    "@id": "bk101",
    "title": "Clean Code",
    "author": "Robert C. Martin",
    "price": { "@currency": "USD", "#text": 34.99 }
  }
}

Frequently asked questions

Is Tagbrace free to use?

Yes. Tagbrace is completely free, needs no sign-up, and has no limits on how often you use it.

Is my data safe? Is anything uploaded?

Nothing is uploaded. All formatting, validation and conversion runs in your browser with JavaScript, so your JSON and XML never leave your computer. That makes it safe for API responses, configuration files and payloads that contain private data.

How do I convert JSON to XML?

Paste your JSON into the input pane and click “JSON → XML”. Objects become nested elements, arrays become repeated elements, keys starting with @ become attributes and #text becomes element text. If the JSON is an array or has several top-level keys, it is wrapped in a root element whose name you can change.

How do I convert XML to JSON?

Paste your XML and click “XML → JSON”. Attributes become keys starting with @, repeated tags become arrays, and text next to child elements is stored as #text. With “Infer types” on, values such as 42 and true become real numbers and booleans.

Why does my XML show as invalid?

XML is stricter than HTML. Common causes are a space before the <?xml ?> declaration, HTML entities such as &nbsp;, an unescaped & character, a namespace prefix like soap: without its xmlns declaration, or more than one top-level element. Tagbrace shows the exact line and column, and Beautify and XML → JSON fix these common issues automatically.

Why does my JSON show as invalid?

The most common JSON mistakes are trailing commas, single quotes instead of double quotes, comments, unquoted property names and values like undefined or NaN. Tagbrace points to the exact line and column and explains what is wrong.

Does beautifying change my numbers?

No. Tagbrace formats JSON without re-encoding values, so very large numbers such as 12345678901234567890 and escape sequences are kept exactly as you wrote them.

Can I convert JSON to XML and back again?

Yes. Convert in one direction, then click the opposite button and Tagbrace converts the output back. A JSON array survives the round trip as an array, and with “Infer types” on, numbers and booleans return as numbers and booleans.