JSON to SQL Query Converter Online

JSON to SQL Query Converter

Convert JSON data to SQL INSERT statements. The JSON should be an array of objects.

Input JSON Data

Ensure the JSON is an array of objects

Table Name

SQL Query:


    

How to Use This Tool

Follow these steps to convert JSON data to SQL INSERT statements:

  1. Paste your JSON data into the input textarea. Ensure it's an array of objects.
  2. Enter the name of the table you want to insert the data into.
  3. Check the "Create table" box if you want to generate a CREATE TABLE statement.
  4. Click the "Generate SQL Query" button.
  5. View the generated SQL query, including CREATE TABLE if selected.

Example

For the following JSON data:

  [
    {"id": 1, "name": "Jimmy Apples", "city": "Paulo Alto"},
    {"id": 2, "name": "Sandy Moran", "city": "Chicago"}
  ]
      

And table name "users" with "Provide Create Table Query" checked, the generated SQL query would be:

  CREATE TABLE users (
      id VARCHAR(255),
      name VARCHAR(255),
      city VARCHAR(255)
  );
  
  INSERT INTO users (id, name, city)
  VALUES
  ('1', 'Jimmy Apples', 'Paulo Alto'),
  ('2', 'Sandy Moran', 'Chicago');
      

Note: All conversion happens at the client browser end. No data is sent to the server.

Comments & Discussion

Facing issues? Have questions? Post them here! We're happy to help!