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.

