SQL to YAML Converter
Paste SQL INSERT statements and get YAML output — list-of-objects by default, with smart string quoting and proper NULL handling.
Last updated: May 27, 2026
Find this tool useful? Support the project to keep it free!
Buy me a coffeeWhat is SQL to YAML Converter?
YAML is the configuration and data-interchange format of choice for many DevOps tools (Kubernetes, Ansible, GitHub Actions, GitLab CI). Converting SQL fixtures to YAML lets you reuse the same data in those tools without manually re-typing it.
This converter parses INSERT statements with a real SQL tokenizer and emits valid YAML. List-of-objects mode produces a top-level array — one entry per row — that you can drop into a config file or feed to a templater. Table-keyed mode wraps that array under the table name, useful when you want to merge multiple tables into one document.
How to Use SQL to YAML Converter
Paste one or more SQL INSERT statements.
Pick an indent (2 or 4 spaces).
Choose a string-quoting strategy: auto (only when YAML requires it), always-double, or always-single.
Toggle "List at root" off to wrap output under the table name.
Copy the YAML output.
Common Use Cases
- Migrating database fixtures into Ansible variable files.
- Generating YAML test data for an integration test suite.
- Producing YAML config from a SQL-based source of truth.
- Converting a SQL dump into Kubernetes ConfigMap data.
Example Input and Output
A multi-row SQL INSERT becomes a YAML list of objects.
INSERT INTO users (id, name) VALUES (1, 'Alice'), (2, 'Bob');- id: 1
name: Alice
- id: 2
name: BobPrivacy
All parsing happens in your browser. No SQL is sent to a server.
YAML 1.2 compatibility
The output follows YAML 1.2 conventions. Older 1.1 parsers may treat unquoted "yes"/"no"/"on"/"off" as booleans — the auto-quoting handles this by wrapping such strings in quotes.
Frequently Asked Questions
When does the tool quote strings?
In auto mode, only when YAML would otherwise parse the value as something else: numeric-looking strings, "true"/"false"/"null", strings starting with special characters, or anything containing colons, hashes, or other YAML-reserved characters.
How are multi-line strings handled?
They become YAML literal block scalars (|) with appropriate indentation. The result round-trips cleanly through any conformant YAML parser.
Does this support SELECT or DDL?
Only INSERT statements. Save SELECT results as INSERT from your database client and paste them here.
Does this send my SQL anywhere?
No. All parsing happens locally in your browser.
Related Tools
SQL to JSON Converter
Parse SQL INSERT statements and output the rows as JSON objects. Handles quoted identifiers, escaped strings, NULL, TRUE/FALSE, and multiple rows per statement.
SQL to CSV Converter
Parse SQL INSERT statements and produce a CSV table. Supports comma, semicolon, pipe, and tab delimiters with proper RFC 4180 quoting.
SQL to HTML Converter
Parse SQL INSERT statements and render them as an HTML table — with the table name as a caption, configurable CSS class, and optional inline styles.
SQL to XML Converter
Parse SQL INSERT statements and serialize them as XML — configurable root and row element names, NULL handled as xsi:nil, indented output, and optional XML declaration.
YAML to JSON Converter
Convert YAML to JSON and JSON to YAML — for config files, CI pipelines, and Kubernetes manifests.
YAML Beautifier
Format and prettify YAML with configurable indentation and optional key sorting. Validates YAML syntax instantly.

