---
title: "SQL to JSON"
description: "Turn SQL INSERT statements into JSON in your browser. Reads mysqldump, SQLite and pg_dump --inserts dumps as text, keeps value types, and uploads nothing."
url: https://findutils.com/convert/sql-to-json/
category: convert
---

# SQL to JSON

Turn SQL INSERT statements into JSON in your browser. Reads mysqldump, SQLite and pg_dump --inserts dumps as text, keeps value types, and uploads nothing.

**Use this tool:** [SQL to JSON](https://findutils.com/convert/sql-to-json/)

## Programmatic access

- REST id `sql-to-json`: POST https://api.findutils.com/api/tools/sql-to-json/execute (reference: https://findutils.com/api/sql-to-json/)
- MCP tool `sql_to_json` on https://mcp.findutils.com (reference: https://findutils.com/mcp/sql-to-json/)

## Why Use Our SQL to JSON Converter?

A .sql dump is the format databases export, and JSON is the format almost everything else reads: API fixtures, mock servers, test data, a quick script. Getting from one to the other normally means restoring the dump into a database, running a query and exporting the result. This page reads the INSERT statements as text instead and hands you JSON with the types intact: NULL is null, TRUE and FALSE are booleans, numbers are numbers. Nothing is uploaded and no SQL is executed, so a dump you are not allowed to send anywhere is still one you can convert here.

## Frequently Asked Questions

### How do I convert a SQL dump to JSON?

Paste the INSERT statements into the SQL panel or drop the .sql file onto it. The JSON appears on the right as you type. Copy it, or download it as a .json file.

### What do I get when the dump has several tables?

With Group by table on, an object keyed by table name, each holding an array of row objects. A dump with rows for only one table gives a plain array. Pick a table from the chips to get just that table, turn grouping off for one flat array across all tables, or download a ZIP with one .json file per table.

### Where do the column names come from when the INSERT has no column list?

From a CREATE TABLE for the same table earlier in the input. If there is none, the columns are named column_1, column_2 and so on by position. So include the CREATE TABLE statements when the dump has them.

### How are NULL, booleans and numbers converted?

NULL becomes null and an unquoted TRUE or FALSE becomes a boolean. An unquoted number becomes a JSON number, written the way JSON writes it (42.50 becomes 42.5). Quoted values stay strings unless Coerce numbers is on. Then the choice is made per column: a quoted column becomes numbers only when every quoted value in it writes back as the same text. A quantity column of '5' and '12' becomes 5 and 12, while a code column holding '007' and '120' stays all strings, so no column mixes types. MySQL booleans stored as TINYINT(1) arrive as 1 and 0 and stay numbers.

### What happens to very large integers such as 64-bit IDs?

A JSON number is a double, which holds integers exactly only up to ±9007199254740991 and about 15 significant digits. An unquoted number beyond that is kept as a string with its exact digits, and a note under the panel says so, rather than being rounded without warning.

### Are INSERT … SELECT statements and functions like NOW() evaluated?

No. Nothing is executed. An INSERT … SELECT has no literal rows in the file, so it is listed under the SQL panel by line number and skipped. A function or keyword such as NOW(), DEFAULT or CURRENT_TIMESTAMP is kept as its SQL text in a string, and a note names the first one found.

### Does it read pg_dump COPY blocks?

No. Only INSERT statements with literal VALUES are read. pg_dump writes COPY … FROM stdin blocks by default; those are not converted, and an apostrophe inside one can stop the parse with an unbalanced-quote error. Export with pg_dump --inserts or --column-inserts to get INSERT statements this page can read.

### Is there a row limit?

The page stops at 50,000 rows per table and tells you when it did, so a very large dump cannot lock up the tab. Dumps over about 2 MB are converted in a background thread so typing stays responsive. Split the file if a table has more rows than the limit.

### Is my SQL uploaded or executed?

Runs in your browser; nothing is uploaded and no SQL is executed. Analytics and ads may load on the page.

### Can I use this from a script or an AI client?

Yes. The same parser is available as a REST endpoint and as an MCP tool, with the same options: grouping, number coercion, a __table field, indent, a single table and a row limit. See the [REST reference](https://findutils.com/api/sql-to-json/) and the [MCP reference](https://findutils.com/mcp/sql-to-json/).

## Related Tools

- [SQL to CSV](https://findutils.com/convert/sql-to-csv/)
- [JSON to SQL](https://findutils.com/convert/json-to-sql/)
- [CSV to SQL](https://findutils.com/convert/csv-to-sql/)
- [JSON Formatter](https://findutils.com/developers/json-formatter/)
- [SQLite Browser](https://findutils.com/developers/sqlite-browser/)
- [JSON to CSV](https://findutils.com/convert/json-to-csv/)
