Format SQL INSERT Statements

Format multi-row INSERT INTO statements so each VALUES tuple sits on its own line. Easier to review seed data and migrations.

Part of the free SQL Formatter. Runs in your browser — nothing is uploaded.

Format SQL INSERT Statements

Bulk INSERT statements are a pain to scan when every row runs together. Formatting puts each row of VALUES on its own line, so reviewing seed data, fixtures and migration scripts becomes straightforward.

Worked example: A three-row INSERT

Input

insert into users (id, name, email, role) values (1, 'Ada', 'ada@example.com', 'admin'), (2, 'Linus', 'linus@example.com', 'dev'), (3, 'Grace', 'grace@example.com', 'dev');

Formatted INSERT

INSERT INTO
  users (id, name, email, role)
VALUES
  (1, 'Ada', 'ada@example.com', 'admin'),
  (2, 'Linus', 'linus@example.com', 'dev'),
  (3, 'Grace', 'grace@example.com', 'dev');

Practical tip

Always list column names in your INSERT. It keeps the statement valid if someone later adds a column to the table.

How to use this SQL Formatter

  1. 1Use the live tool above — it runs entirely in your browser and never uploads your data.
  2. 2Paste the sample from the worked example, or use your own input.
  3. 3Copy the result, then adapt the same steps in your editor, script, or pipeline.

Format SQL INSERT Statements FAQs

Does it support INSERT ... SELECT?

Yes. INSERT INTO ... SELECT statements are formatted like any other query, with the SELECT part indented.

How many rows can I format?

There is no hard limit, but very large dumps are better split into batches for readability and for your database.

More SQL Formatter pages

Open the full SQL Formatter tool →