Skip to main content

SQL Rows to JSON

Convert SQL query results to JSON online. Reads psql output, MySQL console boxes and INSERT statements. Free and private.

Query output

Stays in your browser

JSON

The result appears here after you press Convert.

Shortcuts: Ctrl+Enter run · Ctrl+Shift+C copy result · / search (use ⌘ on Mac)

Next steps

Done here? Use the Send to… menu on the result to carry it on to JSON Beautifier, JSON to CSV or JSON Visualizer.

Free Online SQL Rows to JSON

Copy the result of a query from your database console, paste it here and get JSON. psql tables, MySQL boxes and INSERT statements are recognised automatically. It gives developers a quick browser-based way to solve a focused sql rows to json task before moving the result into a project.

How to use SQL Rows to JSON

Paste your data into the box on the left, or open a file, then press Convert. Paste the table exactly as the console shows it, including the header and separator lines. Numbers and NULL are converted to JSON numbers and null.

Common mistakes

  • Pasting a table without its header line: the first line is used as the column names.
  • Pasting output that was cut or wrapped by a narrow terminal: lines must be complete.

Frequently asked questions

Which formats are understood?
The aligned table printed by psql, the boxed table printed by the mysql client, and INSERT INTO … (columns) VALUES (…) statements.
What happens to NULL?
It becomes JSON null. Empty text stays an empty string.
Why are values like "t" and "f" not true and false?
psql prints booleans as t and f, which are also ordinary text. They are left as written so nothing is guessed wrongly.
Is my data uploaded anywhere?
No. The conversion runs in your browser and nothing you paste or open is sent to a server.
How do I use this sql rows to json tool?
Use the interactive controls above; processing stays in your browser and the result is intended as a practical starting point for development work.

More Formatters & Parsers

View all Formatters & Parsers tools →