32 tools

Code Beautify

Format source code and move structured data between common developer formats.

Choose a conversion below. Every tool includes an instant result, an example and a short explanation.

Choosing the right conversion

A readable representation makes a difference when you inspect an API payload, edit a stylesheet, compare an XML response or document a small SQL query. These tools keep the original data visible beside a transformed result. Formatting changes layout, while conversions change the representation or data model. Choose the operation that matches the material you actually have.

The processors run locally in your browser. Several formats are much larger than any lightweight online editor can implement completely. Each page explains its accepted subset and the cases that require a dedicated parser, compiler or production build tool. In particular, a formatted result is not proof that a script, query or document is safe to execute.

For structured data, check types and field names after conversion. CSV cells are text, XML distinguishes attributes and element content, and YAML supports features beyond the JSON-compatible subset used here. Keep a copy of the source when exchanging data with another system, then test the output in the application that will consume it.

Code BeautifyFormat CSSIndent a CSS stylesheet to reveal rules and declarations.Code BeautifyMinify CSSRemove safe layout whitespace from a CSS stylesheet.Code BeautifyFormat HTMLLay out explicitly nested HTML tags for easier inspection.Code BeautifyMinify HTMLCompact safe structural whitespace in HTML.Code BeautifyFormat XMLIndent simple well-formed XML with visible nesting.Code BeautifyMinify XMLCompact whitespace between element-only XML nodes.Code BeautifyFormat SVGIndent a simple SVG element tree for editing.Code BeautifyMinify SVGCompact whitespace between SVG elements.Code BeautifyFormat SQLPlace common SQL clauses on separate lines.Code BeautifyCompact SQLCollapse extra SQL spacing while keeping quoted values.Code BeautifyFormat JavaScriptIndent simple JavaScript blocks and explicit statements.Code BeautifyJSON to YAMLWrite JSON values in a readable YAML subset.Code BeautifyYAML to JSONConvert a supported YAML mapping or list into JSON.Code BeautifyJSON to CSVTurn a flat JSON object array into CSV rows.Code BeautifyCSV to JSONTurn a header-based CSV table into JSON objects.Code BeautifyJSON to XMLMap a JSON object with one root to XML elements.Code BeautifyXML to JSONMap a simple XML document to a JSON object.Code BeautifyMarkdown to HTMLRender common Markdown headings, lists and emphasis as HTML.Code BeautifyHTML to MarkdownConvert supported semantic HTML tags to Markdown.Code BeautifyEscape JavaScript stringTurn text into a quoted JavaScript string literal.Code BeautifySort JSON keysAlphabetize object keys recursively without changing array order.Code BeautifyFlatten JSON objectTurn nested JSON object properties into JSON Pointer path keys.Code BeautifyUnflatten JSON objectRebuild nested JSON objects from JSON Pointer path keys.Code BeautifyEscape JSON Pointer tokenEscape a property name for use as one JSON Pointer token.Code BeautifyUnescape JSON Pointer tokenRecover a property name from one JSON Pointer token.Code BeautifyQuery string to JSONRead URL query parameters as a JSON object, retaining repeated keys.Code BeautifyJSON to query stringWrite a flat JSON object as URL query parameters.Code BeautifyCSV to TSVChange a comma-separated table into tab-separated text.Code BeautifyTSV to CSVChange a tab-separated table into comma-separated text.Code BeautifyJSON Lines to arrayCombine one JSON value per line into a JSON array.Code BeautifyJSON array to LinesWrite every item of a JSON array on its own JSON line.Code BeautifyUnescape JavaScript stringRead a quoted JSON-compatible JavaScript string literal as plain text.

Common questions

Will formatting change how my code runs?

These tools aim to make supported syntax easier to read or more compact, but a formatter is not a compiler or full language parser. Some tools deliberately reject constructs outside their documented subset. Check the output in the destination parser, run your normal tests and review a diff before replacing production code.

Can I freely convert among JSON, YAML, CSV and XML?

Each format has a different data model. CSV is tabular, XML has elements and attributes, and YAML offers syntax beyond the subset supported here. The tools document their mapping and reject some unsupported structures. Convert a representative sample first, compare meaningful values on a round trip, and keep the original file.

Explore guides

Conversion guides

Explore guides
Code BeautifyHow to format and minify code without losing meaning A practical CSS, HTML, JavaScript and JSON formatting workflow with examples, checks and the limits of automatic minification.Read guideCode BeautifyBuild a URL query string without double encoding Understand the difference between a query string and one encoded value, including spaces, ampersands and repeated keys.Read guideCode BeautifyJSON and XML conversion: what survives a round trip? Work through attributes, repeated elements and value types before converting structured data between JSON and XML.Read guideCode BeautifySVG is XML: format, minify and verify the graphic Follow an SVG workflow from XML structure to readable markup and compact output while checking viewBox, text, accessibility and rendering.Read guideCode BeautifyCSV vs TSV: delimiters, quotes and spreadsheet surprises Choose comma- or tab-separated data, understand quoting through a worked example, and check what spreadsheets may change.Read guideCode BeautifyFormat or compact SQL: what the layout can and cannot prove Make a query easier to review, understand the limits of compacting SQL and test syntax, comments and execution separately.Read guideCode BeautifyMarkdown and HTML: what changes in a round trip? Turn a small Markdown document into HTML and back, then see why markup, escaping and unsupported syntax need review.Read guideCode BeautifyJSON Pointer and flattened paths: how do keys become addresses? Escape a key containing a slash and tilde, compare JSON Pointer with a flattened object, and avoid ambiguous paths.Read guideCode BeautifyFrom spreadsheet rows to API records: what should you check? Walk a two-row CSV through JSON and JSON Lines while checking headers, types, empty cells and destination expectations.Read guideCode BeautifyJSONL to CSV for Excel: convert records without losing data Turn JSON Lines into a CSV table for Excel, then protect identifiers, check empty values and verify imported columns.Read guide

Explore every category