Polymorpher
The Utility Factory — Free Developer Tools
Convert, transform, beautify & decode — all in one place.
⚡ All Tools
Did You Know?
Select a tool from the sidebar to get started, or explore our free developer utilities.
About this Tool
Code Beautifier & Formatter — JSON, XML, SQL, CSS, HTML & C#
Polymorpher's free online code beautifier instantly formats and indents 6 code formats: JSON, XML, SQL, CSS, HTML, and C#. Simply paste your minified or messy code and get perfectly formatted, readable output — format is detected automatically.
Supports JSON beautification with proper nesting, XML/HTML formatting with tag-aware indentation, SQL formatting with keyword-aligned structure, and CSS formatting with property-per-line layout.
The reverse transform acts as a code minifier — compressing formatted code back into compact form for production deployments, API payloads, or bandwidth optimization.
Supported Formats
- JSON — Pretty-print with proper indentation
- XML & HTML — Tag-aware formatting
- SQL — Keyword-aligned structure (SELECT, FROM, WHERE, JOIN)
- CSS — Property-per-line layout
- C# — Brace-based indentation
Live Examples
Example 1 — Beautify minified JSON
Input:
{"name":"Polymorpher","version":2,"features":["json","xml","sql"]}
Output:
{
"name": "Polymorpher",
"version": 2,
"features": [
"json",
"xml",
"sql"
]
}
Example 2 — Format a SQL query
Input:
SELECT u.id, u.name, o.total FROM users u INNER JOIN orders o ON u.id = o.user_id WHERE o.total > 100 ORDER BY o.total DESC
Output:
SELECT
u.id, u.name, o.total
FROM
users u
INNER JOIN
orders o
ON
u.id = o.user_id
WHERE
o.total > 100
ORDER BY
o.total DESC
Example 3 — Format minified CSS
Input:
.card{padding:1rem;border:1px solid #ccc;border-radius:8px}.card:hover{box-shadow:0 2px 8px rgba(0,0,0,.1)}
Output:
.card {
padding: 1rem;
border: 1px solid #ccc;
border-radius: 8px;
}
.card:hover {
box-shadow: 0 2px 8px rgba(0,0,0,.1);
}
Example 4 — Minify (reverse transform)
Click the swap/reverse button to compress formatted code back into a single line — useful for reducing payload size in API responses or config files.
How Auto-Detection Works
- Starts with
{or[→ tries JSON parsing - Starts with
<→ tries XML, then falls back to tag-based HTML formatting - Starts with SQL keywords (SELECT, INSERT, CREATE, etc.) → SQL formatting
- Contains CSS-like patterns (selectors + braces + semicolons) → CSS formatting
- Everything else → brace-based C# formatting
When to Use
- Making minified API responses readable for debugging
- Formatting SQL queries before pasting into documentation
- Cleaning up copied code snippets from Stack Overflow
- Minifying JSON/CSS/XML for production (reverse mode)
Limitations
- SQL formatting uses keyword-based heuristics — complex subqueries may not align perfectly
- C# formatting handles indentation only; it does not reorder or restructure code
- The HTML formatter works on tag structure, not DOM semantics — inline elements may get extra line breaks
Related Tools: JSON to Code Classes · Regex Tester · Base64 Encoder