Free tool XML formatter, SQL formatter and YAML validator
Paste a one-line SQL query, a minified sitemap or a CI config. The formatter lays it out with consistent indentation, and when the text is broken it says where: the line, the column and what the parser expected.
- SQL · XML · YAML
- Errors by line
- Runs locally
Format and check
The sample is a sitemap squeezed onto one line. Load the SQL or YAML example with the buttons, or paste your own; the result updates as you type.
Paste text or open a file. Files stay on this device.
Decides which quotes, comments and keywords are recognised. TapCub SQL also checks the rules of the SQL playground in TapCub Insights.
Applies to keywords, function names and data types. Identifiers and strings never change.
Lines
18
In the formatted result.
Size (bytes)
696
UTF-8 size of the formatted result.
Elements
12
Every XML element, nested ones included.
Statements
—
Separated by semicolons.
Documents
—
YAML documents separated by ---.
Keys
—
Mapping keys at every level.
Checks
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml">
<url>
<loc>https://www.example.com/</loc>
<lastmod>2026-11-10</lastmod>
<xhtml:link rel="alternate" hreflang="en" href="https://www.example.com/"/>
<xhtml:link rel="alternate" hreflang="zh-Hans" href="https://www.example.com/zh/"/>
</url>
<url>
<loc>https://www.example.com/pricing?plan=pro&billing=yearly</loc>
<lastmod>2026-11-02</lastmod>
</url>
<!-- blog posts are listed in sitemap-blog.xml -->
<url>
<loc>https://www.example.com/blog/utm-guide</loc>
<lastmod>2026-10-28</lastmod>
</url>
</urlset>
Version v1.0Updated Update history
Valid, broken, or valid but surprising
Every format gets the same three kinds of feedback. The summary line above the result tells you which one you have.
Errors
The text cannot be parsed. For XML and YAML this is where a strict parser stops; for SQL it is an unclosed quote, comment or bracket, or a spot the formatter could not read. The line and column point at the problem or just after it.
Checks
The text is valid, but something in it is likely to bite later: a YAML value that another parser reads as a different type, or a TapCub SQL rule the playground would reject. Each check says what will happen and how to avoid it.
Notes
What the formatter changed beyond whitespace: YAML comments and anchors are not carried over, compact mode drops comments.
Counts
Lines and bytes of the result, plus a count for the format: XML elements, SQL statements, YAML documents and keys. A sitemap's element count is a quick check that all URLs made it in.
XML and SQL are reformatted from the original text, so values never change. YAML is parsed and written out again, so equivalent values may be written differently: 3.10 becomes 3.1 and an empty value becomes null, exactly as any program reading the file would see them.
Three steps
Nothing to install; the text never leaves your browser.
-
1
Pick the format
XML, SQL or YAML. For SQL, also pick the database, because quoting and comment rules differ:
#starts a comment in MySQL,[name]is a quoted name in SQL Server. -
2
Paste or open
Paste the text or open a
.xml,.sqlor.yamlfile. Errors and checks appear under the counts, each with its line number. -
3
Copy or download
Copy the formatted result or download it. Use Compact to squeeze XML or SQL onto one line for a config value or an API call.
What is checked, and against which rules
Each format has its own definition of valid. The tool follows the published specification where there is one, and says so where it relies on a library.
- XML: the well-formedness rules of XML 1.0 (Fifth Edition). It stops at the first fatal error, as conforming XML parsers must. DTD and schema validation are not done
- SQL: formatting by sql-formatter 15.9.0; quotes, comments and brackets are checked separately for every dialect. Table and column names are not checked against any database
- YAML: parsed as YAML 1.2 by js-yaml 4.3.2 (duplicate keys and tab indentation are errors), then checked line by line for values YAML 1.1 parsers read differently
| Format | Check | Rule |
|---|---|---|
| XML | One root element; tags closed and nested in order | XML 1.0 §2.1, §3 |
| XML | Attributes quoted, no duplicates, no < in values | XML 1.0 §3.1 |
| XML | & starts an entity or character reference; only five entities are predefined | XML 1.0 §4.1, §4.6 |
| XML | No -- inside comments; declaration first in the file | XML 1.0 §2.5, §2.8 |
| SQL | Strings, quoted names and block comments closed; brackets balanced | Each dialect's quoting rules |
| SQL · TapCub | One SELECT or WITH, no comments, semicolons, backticks or writes, at least one of the four views | Same checks as the SQL playground in TapCub Insights |
| YAML | Indentation, duplicate keys, unclosed quotes and brackets | YAML 1.2.2 |
| YAML | Unquoted yes / no / on / off, leading zeros, 3.10, 22:22 | YAML 1.1 types (yaml.org/type) |
The YAML example, read by two parsers
The YAML example is a CI workflow. It is valid, yet the values in the first two rows mean different things depending on the parser that reads them; the last three rows are other common cases. This is what the checks warn about.
| Written as | YAML 1.2 (this tool, js-yaml) | YAML 1.1 (for example PyYAML) | Safe form |
|---|---|---|---|
on: as a key | the string "on" | the boolean true | "on": |
3.10 in a version list | the number 3.1 | the number 3.1 | "3.10" |
0755 | the number 755 | the number 493 (octal) | "0755" or 0o755 |
2222:22 (port mapping) | the string "2222:22" | the number 133342 (base 60) | "2222:22" |
no | the string "no" | the boolean false | "no" |
GitHub Actions reads on: correctly, so the workflow runs; the warning matters when the same file is read by a Python script or another YAML 1.1 tool. The version list is wrong for every parser: 3.10 asks for Python 3.1.
Why these files fail to parse
Most errors come from writing one format with the habits of another.
HTML habits in XML
Unquoted attributes, <br> without a closing slash, and attributes without values are fine in HTML and fatal in XML. Use <br/> and  .
A raw & in a sitemap URL
The sitemaps.org protocol requires entity escaping in URLs, so a link with several query parameters is written with & inside <loc>. A sitemap that is not well-formed cannot be read at all, so search engines report an error instead of the URLs.
YAML that changes type
Versions, ZIP codes, port mappings and words like no or on need quotes. The file still parses, so nothing fails until a value arrives as the wrong type.
Formatted is not the same as correct
A query can format cleanly and still name a column that does not exist. The SQL check is about syntax; run the query to check the meaning.
SQL over your own analytics data
When the built-in reports do not answer a question, TapCub Insights has an SQL playground over four views of your project's data. The project and time range are filled in for you, so a query cannot read another project.
SQL in pro mode
One SELECT or WITH over v_events, v_sessions, v_persons and v_autocapture. The TapCub SQL dialect here runs the same checks before you paste a query in.
Export and open API
Export any table as CSV, or query metrics and events from your own systems.
Learn moreSearch data next to traffic
Google Search Console and Bing Webmaster in one view; bind Baidu Webmaster to push new URLs.
Learn moreFormatter questions
Still have a question?
Chat with the team behind TapCub — we usually reply within a few hours on business days.
How do I format XML online and check that it is valid?
Paste it with XML selected (the default): elements are indented by level and the result can be copied or downloaded. "Well-formed" means it follows the XML 1.0 syntax rules: one root, matching tags, quoted attributes, escaped & and <. Validation against a DTD or XSD schema is a separate step this tool does not do.
How do I format SQL online?
Choose SQL, pick your database in the dialect list and paste the query. Keywords are uppercased (or lowercased) and each clause goes on its own line. If the query has an unclosed quote or bracket, you get the line and column instead of a half-formatted result.
Which SQL dialect should I choose?
The database the query runs on. Dialects differ in quoting (`name` in MySQL, [name] in SQL Server, "name" in PostgreSQL), comments and some keywords. For TapCub's SQL playground choose TapCub SQL: it formats like MySQL and adds the playground's rules.
Why did 3.10 turn into 3.1 in my YAML?
Because unquoted 3.10 is a number, and the number 3.10 is 3.1. Every YAML parser does this; formatting just makes it visible. Quote version numbers: "3.10". The checks list flags these values before they cause a wrong install.
Why are my YAML comments gone after formatting?
YAML is formatted by parsing it and writing the data out again, and comments are not part of the data. The tool tells you how many were dropped. If you only want to validate, read the checks and keep your original text.
Does the SQL formatter check that my query will run?
No. It checks syntax that does not depend on your database: closed quotes, comments and brackets, and whether the formatter can read the statement. Whether tables and columns exist, or whether you have permission, only the database can tell.
What is the Norway problem in YAML?
In YAML 1.1 an unquoted NO, the ISO code for Norway, is the boolean false. YAML 1.2 fixed this, but many tools still parse 1.1. The same applies to yes, on and off; this tool flags them in block values.
Is my data uploaded?
No. Formatting and checking run in your browser; the SQL and YAML libraries are downloaded once from tapcub.com and run locally. There is no share link, so pasted queries and configs never end up in a URL.
Update history
New features, fixes and data refreshes for this tool, newest first.
-
· v1.0
LaunchedFirst release.
Missing something or found an error? Tell us — requests that come up often go into the next update. All tool updates
Query your own analytics with SQL
Built-in reports cover most questions. When they do not, Insights pro mode lets you write SQL over your project's events, sessions and people.