Excel to PostgreSQL

Turn an Excel sheet into a PostgreSQL table with matching column types and INSERT statements you can run in pgAdmin or psql.

Your files never leave your device. Everything runs in your browser.

How it works

  1. Add your Excel dataOpen the file or paste the cells into the input box. The first row becomes the column names.
  2. Check the settingsThe database is already selected. Type the table name and choose how many rows go into each INSERT.
  3. Copy or downloadCopy the SQL or download it as a .sql file and run it in your database tool.

PostgreSQL specific details

Names are quoted with double quotes, decimals use NUMERIC with the right precision, true and false become real BOOLEAN values and date columns become DATE or TIMESTAMP.

Turn on the transaction option to import everything at once and roll back automatically if a row fails.

About Excel

XLSX is the standard Excel format since 2007. It stores each sheet as a grid of cells with values and formatting. Dates are stored as numbers internally; the tool turns them back into readable dates before writing the SQL.

About SQL

SQL is the language relational databases understand. CREATE TABLE defines the columns and their types, INSERT adds the rows. The generated script can be run in SQL Server Management Studio, MySQL Workbench, pgAdmin or any database client.

Frequently asked questions

Should I keep names quoted?

PostgreSQL folds unquoted names to lower case. Simplify names gives lower case names without spaces, which are the easiest to work with.

Is my data uploaded anywhere?

No. Everything runs in your browser. Your spreadsheet is not sent to our servers.

Can I paste data directly from Excel?

Yes. Select the cells in Excel, copy them and paste into the input box. The tool recognizes the tab separated format automatically.

Which Excel files are supported?

Modern .xlsx files from Excel, Google Sheets and LibreOffice. Old .xls files need to be saved as .xlsx first. Files with several sheets let you choose the sheet.

Why are my column names changed?

With Simplify names on, spaces and special characters are replaced, for example Product Name becomes product_name. Turn it off to keep the original names in quotes.

Does it work without an internet connection?

Yes. After you open the page once, it keeps working even if your connection drops.