search
format_align_left
JSON Formatter CSS Formatter HTML Formatter JavaScript Formatter XML Formatter SQL Formatter Exception Formatter Markdown Preview & HTML to Markdown
data_object
JSON to Excel/CSV JSON to TypeScript, C#, Go, Java, Kotlin, Python & Dart JSON ⇄ YAML / TOML Converter JSON Diff – Compare Two JSON JSON Viewer & JSONPath Tester
table_chart
Excel/CSV to JSON Excel/CSV to SQL Excel/CSV to HTML
description
Compare text Text to Hex Text to Base64 Case Converter Regex Tester Vietnamese Accent Remover & Slug Generator Word Counter Line Tools: Remove Duplicates, Sort Lines Lorem Ipsum Generator
image
Convert Image Image to Base64 Converter Image Compressor Resize & Crop Image Favicon Generator Color Palette from Image EXIF Viewer & Remover
qr_code_2
QR Code Generator QR Code Scanner VietQR Bank Transfer QR Generator Wi-Fi QR Code Generator vCard QR Code Generator (Business Card) Barcode Generator (EAN-13, Code 128, Code 39)
lock
Convert Token Convert Hash Generate Password HMAC Generator (SHA-256, SHA-512) AES Encrypt / Decrypt Online Bcrypt Hash Generator & Checker
schedule
Convert datetime Timezone Info Vietnamese Lunar Calendar Converter Date Calculator Cron Expression Parser Countdown Timer
link
Encode and Decode URLs Shorten URL URL Parser & UTM Builder HTTP Header Checker
storage
Statistics Parser Statistics Compare SQL INSERT to JSON Converter SQL Table to C# / TypeScript / Java Class
travel_explore
Create Sitemap robots.txt Generator Meta Tag Generator Open Graph Preview
terminal
Number Base Converter UUID / ULID / NanoID Generator Chmod Calculator HTTP Status Codes
palette
Color Picker
help_outline
About UsPrivacy PolicyTerms of Service
THUTOOL
search

SQL INSERT to JSON Converter

🔒 Processed 100% in your browser – your data never leaves your device

How to convert SQL INSERT statements to JSON

  1. Choose INSERT → JSON and paste one or more INSERT INTO ... VALUES (...) statements. The JSON appears as you type.
  2. Pick the output shape: a plain array, or an object grouped by table name. When the script inserts into several tables, the result is always grouped.
  3. Copy the JSON or download it as data.json.

To go the other way, choose JSON → INSERT, paste a JSON array of objects, enter the table name and pick SQL Server, MySQL or PostgreSQL. You can also set how many rows go into one INSERT and add a CREATE TABLE with column types guessed from the data.

Example

INSERT INTO [dbo].[Users] ([Id], [Name]) VALUES (1, N'O''Brien'), (2, NULL); becomes [{"Id": 1, "Name": "O'Brien"}, {"Id": 2, "Name": null}].

What the parser understands

  • Quoted names [x], `x`, "x" and schema names such as dbo.Users.
  • Strings with '', prefixes N'...' and E'...', MySQL backslash escapes (turned on automatically when the script uses backticks).
  • NULL, TRUE/FALSE, numbers, hex 0x..., comments, GO and scripts without semicolons (SSMS "Generate Scripts").
  • Function calls such as GETDATE() are kept as text.

FAQ

What if the INSERT has no column list? The keys are named column1, column2... in order.

Why is a number shown as a string? Integers larger than 9,007,199,254,740,991 and decimals with more than 15 significant digits cannot be stored exactly in a JavaScript number, so they are kept as strings to avoid changing the value.

Is INSERT ... SELECT supported? No. It has no literal values to convert, so the tool reports an error at that position.

Why does SQL Server get at most 1000 rows per INSERT? SQL Server rejects a VALUES list with more than 1000 rows, so larger batches are split automatically.

Related tools

  • Statistics ParserParse SQL Server SET STATISTICS IO and TIME output into readable tables with totals for logical reads, CPU and elapsed time.
  • Statistics CompareDiscover the power and convenience of our robust SQL Statistics Parser tool for effortless query analysis. Uncover valuable insights from query execution plans, performance metrics, and resource utilization to optimize your database's efficiency. Our user-friendly interface and comprehensive parsing capabilities make it simple to compare SQL statistics with ease. Experience the strength and convenience of our SQL Statistics Parser now and take your database performance to new heights.
  • SQL Table to C# / TypeScript / Java ClassGenerate a C# entity (EF Core), TypeScript interface or Java class from CREATE TABLE for SQL Server, MySQL and PostgreSQL. Runs in your browser.
  • HMAC Generator (SHA-256, SHA-512)Compute HMAC-SHA1, SHA-256, SHA-384 or SHA-512 with a text, hex or Base64 key. Hex/Base64 output as you type, using Web Crypto in your browser.
  • robots.txt GeneratorCreate a robots.txt file: disallow paths, block AI crawlers (GPTBot, CCBot, ClaudeBot), per-bot rules, crawl-delay and sitemap. Runs in your browser.
  • HTTP Header CheckerCheck the status code, 301/302 redirect chain and response headers of any URL, and grade security headers like HSTS, CSP and X-Frame-Options.
@Made by THUTOOL