Formatting and validation tools
Structured data needs to be readable by humans and machines. These tools make JSON and XML easier to inspect, edit, and validate without installing anything.
JSON
JSON Formatter
Format, validate, minify, and sort JSON. Free, offline, runs in your browser.
JSON Validator
Validate JSON and get the exact error location for invalid input.
JSON Minifier
Remove all non-essential whitespace from JSON.
JSON Viewer
Explore JSON as a collapsible tree.
JSON Compare
Semantic JSON diff that ignores key order and whitespace.
JSON Schema Validator
Validate a JSON document against a JSON Schema. Lists every error with its path. Draft-07. Runs entirely in your browser.
XML
XML Formatter
Format, validate, and minify XML. Free, offline, runs in your browser.
XML Validator
Validate XML and get the exact error location.
XML Minifier
Remove all non-essential whitespace from XML.
XML to JSON
Convert XML to JSON and JSON to XML. Attributes become @keys, text becomes #text, repeated elements become arrays. Runs in your browser.
Sitemap Validator
Validate a sitemap XML file against the sitemaps.org protocol.
YAML
MIME
MIME Type Lookup
Look up the MIME type for any file extension, or find extensions for a MIME type. Complete IANA registry. Runs in your browser.
File Signature Identifier
Identify a file's format from its magic bytes. Drop a file or paste hex to detect PNG, JPEG, PDF, ZIP, MP4, executables, and 40+ formats.
About format tools
JSON is the lingua franca of APIs and configuration. Formatting it with indentation makes it readable. Minifying it removes whitespace before transmission. Validating it catches trailing commas, unescaped quotes, and other common syntax errors before they reach a server.
XML is stricter and more expressive than JSON, and still used in SOAP APIs, RSS feeds, sitemaps, and configuration files. Small mistakes in XML nesting produce cryptic parser errors; these tools point to the exact line and character.
All processing happens in your browser. Large documents are handled with a streaming formatter where possible, and nothing is uploaded to a server.
When to use these tools
- You pasted a minified JSON response and need to see the structure. JSON Formatter indents it; JSON Viewer makes long documents collapsible.
- Your JSON fails a linter and the error message does not say where. JSON Validator shows the exact line and character.
- You are comparing two JSON files by hand and key order should not matter. JSON Compare does a semantic diff that ignores whitespace and ordering.
- You have an XML sitemap or SOAP response that is unreadable on one line. XML Formatter re-indents it and XML Validator locates errors.
- You are writing YAML or TOML configuration and want to catch a syntax error before committing. YAML Formatter and TOML to JSON both validate as they convert.
- You are configuring a web server and need the MIME type for an extension, or the extension for a MIME type. MIME Type Lookup covers the full IANA registry.
- You have a file with a misleading extension and want to know what it actually is. File Signature Identifier reads the magic bytes.
Which tool should I use?
| If you need... | Use... | Why |
|---|---|---|
| Pretty-print JSON | JSON Formatter | Indent, minify, or sort keys |
| JSON syntax error location | JSON Validator | Line and column of the first problem |
| Compare two JSON docs | JSON Compare | Semantic diff, order-insensitive |
| Validate against a schema | JSON Schema Validator | Draft-07, lists every path error |
| YAML to JSON | YAML to JSON | Round-trip, preserves multi-doc streams |
| TOML to JSON | TOML to JSON | Exact conversion, clear errors |
| CSV to JSON | CSV to JSON | Handles headers and TSV |
| Format SQL | SQL Formatter | 19 dialects including PostgreSQL and BigQuery |
| Extension to MIME type | MIME Type Lookup | Full IANA registry |
| File bytes to type | File Signature Identifier | Magic-byte detection, 40+ formats |
| Format or minify HTML | HTML Formatter | Prettier-based, preserves embedded CSS and JS |