Favorite places of your favorite city
Home
Add to preferred sources on Google

XML Formatter

Make an XML document easier to read, or remove selected layout whitespace with Compact. Processing stays in your browser; formatting can change whitespace and is not schema validation or canonical XML.

Before formatting

Formatting can change XML whitespace and lexical representation; it is not lossless or canonical XML. A checked result is not schema, business-rule, security or signature validation.

XML output

Format or compact a document to see its checked output.

XML is processed locally without tool-added uploads, saved history or external resource retrieval. Copy and download are explicit actions. The site's general privacy policy still applies.

How to format XML

  1. Paste one XML document or open one UTF-8 file up to 2 MiB. The tool supports XML 1.0 without a DOCTYPE; it does not open URLs or fetch schemas.
  2. Choose Pretty with two spaces, four spaces or tabs, or deliberately choose Compact. Read the whitespace warning, then run the selected action.
  3. Review the current checked output and any preview-truncation notice. Copy XML or download the complete UTF-8 file; edits and setting changes retire the previous result.

What the formatter checks and changes

Well-formedness checks document structure, legal characters and namespace bindings, including attributes that resolve to the same expanded name. It does not establish that an XML document follows a schema or means what an application expects.

Pretty replaces direct whitespace around child elements only in eligible containers. Compact removes the same whitespace without adding indentation. Without a schema, that whitespace cannot generally be proved insignificant, so neither operation promises semantic equivalence.

Subtrees rooted at elements with direct mixed text, direct CDATA or xml:space="preserve" keep their text layout, even across a descendant default reset. Whitespace-only leaves are retained. Comments, processing instructions, namespace declarations and child order are not discarded.

Output always uses an XML 1.0 UTF-8 declaration, no BOM and a final LF. Quote style, references, empty tags, line endings and processing-instruction separators can change. Escaping preserves parsed attribute controls and text carriage returns rather than accidentally changing them on the next parse.

Examples worth checking

The document <r> <a/> </r> gains line breaks and indentation in Pretty; Compact writes <r><a/></r> after the normalized declaration. Those layout changes alter character data even when the elements look unchanged.

In <p>Hello <b>world</b> !</p>, the spaces belong to mixed text. Its entire subtree keeps that text layout instead of splitting the sentence across new lines.

The attributes a:id and b:id conflict when both prefixes name the same namespace. An unprefixed id, however, is not put into an element's default namespace. Changing a prefix's spelling alone does not resolve an expanded-name duplicate.

Important limits

Only XML 1.0 and UTF-8 file input are supported. XML 1.1, other encoding declarations, every DOCTYPE and custom entities are rejected. Namespace URIs and stylesheet instructions are never opened.

This is not DTD or XSD validation, canonical XML, a signature checker, an XML-to-JSON converter or a repair tool. Do not substitute its normalized output for an original whose exact bytes or signature must be retained.

Input is limited to 2 MiB, depth 128, 100,000 records and 128 attributes per element; token limits also apply. Output is limited to 8 MiB. A near-line error marks where checking noticed a problem, not necessarily where the malformed token began.

The visible preview is capped, but current Copy and download contain the complete verified output. A cancelled, failed or timed-out operation has no downloadable partial result; resource limits are not a guarantee about every browser's memory use.

Local document processing

The tool processes your XML locally and does not upload or retain the source or result. Copy and download are explicit actions; downloaded files and clipboard contents remain under your browser and operating system's controls.

XML formatting questions

Yes. Pretty and Compact deliberately replace or remove selected whitespace text. Mixed content, CDATA and preserved subtrees receive conservative protection, but the tool cannot prove application-level equivalence without your application's rules.

No. Checked means supported-profile, namespace-aware well-formedness. The tool does not fetch or validate a DTD, XSD, business rule or digital signature.

Paste Unicode text or open a UTF-8 file, optionally with one leading BOM. XML 1.0 is supported; other versions or non-UTF-8 encoding declarations are rejected. Downloads are UTF-8 without a BOM.

The formatter has no DTD or custom-entity resolver and never retrieves external definitions. The five predefined entities and valid numeric character references are supported; a DOCTYPE-looking string inside a comment or CDATA is just content.

A subtree with mixed text, any direct CDATA, inherited protection or xml:space="preserve" keeps its text layout. A descendant xml:space="default" does not undo this formatter's conservative whole-subtree protection.

No. If the preview is truncated, it shows a notice. Current Copy XML and Download XML use the complete verified output, including its normalized declaration and final LF.

No. XML is processed locally without upload, saved history or external resource retrieval. A namespace URI identifies a namespace; it is not an instruction to fetch that address.

Sources

These references describe the XML profile and parser dependencies; they do not certify this implementation or validate your document against a schema.

The tool rejects DOCTYPE and does not fetch external resources or validate schemas.

References reviewed 2026-11-08.

JSON to YAML

Convert JSON to YAML locally while preserving number text and quoted strings; copy or download the complete result.

Open tool — JSON to YAML

YAML to JSON

Convert one YAML document locally to JSON with exact number text and bounded aliases, then copy or download the complete result.

Open tool — YAML to JSON

HTML to Markdown

Convert pasted or local HTML into Markdown, review conversion notes, and copy or download the result.

Open tool — HTML to Markdown

JavaScript Regex Tester

Test a JavaScript pattern locally and inspect matches, captures, and UTF-16 positions.

Open tool — JavaScript Regex Tester

Markdown to HTML

Convert a Markdown draft to an HTML fragment, inspect the source and inert preview, then copy or download it.

Open tool — Markdown to HTML

Text Sorter

Sort lines alphabetically by a chosen language or by Unicode code point, keeping duplicates, blank rows and complete line contents.

Open tool — Text Sorter

Remove Duplicate Lines

Keep the first copy of each exact text line, preserving order, significant spaces and blank rows, then copy or download the result.

Open tool — Remove Duplicate Lines

Text Diff Checker

Compare two drafts locally, with exact whole-line changes, visible whitespace rules and clear final-newline handling.

Open tool — Text Diff Checker

Case Converter

Convert text to uppercase, lowercase, capitalized words or sentence case with explicit letter rules.

Open tool — Case Converter

HTML Entity Encoder/Decoder

Encode or decode literal HTML references with explicit context, Unicode options and LF output, without parsing or rendering markup.

Open tool — HTML Entity Encoder/Decoder

Markdown Table Generator

Edit a small literal-text table, set alignment and copy GFM Markdown or import tab-separated text.

Open tool — Markdown Table Generator

Query String Parser & Builder

Edit ordered URL parameters, retain repeated names and copy a normalized query or HTTP(S) URL.

Open tool — Query String Parser & Builder

URL Encoder & Decoder

Convert a UTF-8 URL component or form value with explicit space and plus rules, then copy or download the result.

Open tool — URL Encoder & Decoder

Base64 Encoder & Decoder

Encode UTF-8 text as standard or URL-safe Base64, or decode either format with clear errors and complete text output.

Open tool — Base64 Encoder & Decoder

JSON Formatter & Validator

Check JSON syntax, format or minify locally, and copy or download output while preserving original data tokens.

Open tool — JSON Formatter & Validator

SMS Character Counter & Segment Calculator

See how your message is encoded, where its segments end and what it may cost. Your text stays in your browser.

Open tool — SMS Character Counter & Segment Calculator

Social Media Character Counter

Check platform-specific limits and split posts without losing text.

Open tool — Social Media Character Counter

Character Counter

Count characters, words, sentences and paragraphs. Check word density, reading time and UTF-8 size, all in your browser.

Open tool — Character Counter

Text Size Calculator

Compare text encodings and payload sizes in your browser.

Open tool — Text Size Calculator

PDF Text Cleaner

Fix line breaks and spacing in text copied from a PDF. Preserve your original and review ambiguous hyphens before copying the cleaned text.

Open tool — PDF Text Cleaner

Fancy Text Converter

Convert supported fancy Unicode letters to normal text locally. Keep case, accents, emoji and your original text.

Open tool — Fancy Text Converter

Garbled Text Fixer

Fix garbled text and repair broken accents with a browser-based mojibake fixer. Review each possible UTF-8 reversal before applying it.

Open tool — Garbled Text Fixer

Gmail Clipping Checker

Measure email HTML bytes in UTF-8, compare them with an advisory 102,000-byte Gmail reference, and inspect size contributors locally.

Open tool — Gmail Clipping Checker
View all tools in this category