How to reorder excel columns to match your database table schema
- Step 1List your table's column order from the schema — Run
\d table_namein psql,DESCRIBE table_name;in MySQL, orPRAGMA table_info(table_name);in SQLite. Note the columns top-to-bottom — that is the left-to-right order your file needs for a positional import. - Step 2Upload your export — Drop the
.xlsxor.csv. The tool reads the first sheet and uses row 1 as the header, listing each column as a numbered, reorderable row. - Step 3Reorder to match the schema — Use the up/down arrows to move each column so the list mirrors the
CREATE TABLEcolumn sequence exactly — same columns, same order. The first/last rows disable the arrow that would push them off the ends. - Step 4Drop any columns the table does not have — This tool keeps every column. If your export has extra fields, send them to the bottom and remove them with csv-column-remover before importing, or supply an explicit column list in your
COPY/INSERTso the extras are ignored. - Step 5Apply and download — Click
Apply order, check the 10-row preview, then download. An Excel upload returns an.xlsx; a CSV returns a.reordered.csv. ForCOPY/.importyou generally want CSV — export your sheet as CSV first if your importer reads CSV only. - Step 6Import and spot-check the first rows — Run the import, then
SELECT * FROM table LIMIT 5;and confirm each value landed in the right column. A positional mismatch shows up here as plausible-but-wrong data (a city in the state column), which is why the spot-check matters.
How common importers bind columns
Whether order matters depends on whether the importer binds by position or by name. When it binds by position, your file order must equal the table order.
| Importer | Binds by | Order matters? |
|---|---|---|
PostgreSQL COPY table FROM ... CSV (no column list) | Position | Yes — file column N → table column N |
PostgreSQL COPY table (col1,col2,...) FROM ... | Explicit list | Less so — but the file must still match the listed order |
SQLite .import file table | Position | Yes |
MySQL LOAD DATA INFILE (no column list) | Position | Yes |
| pgAdmin Import/Export wizard | Name or position (configurable) | Easier when the file already matches |
| MySQL Workbench Table Data Import | Name (mapped in UI) | Matching order speeds the mapping step |
What the reorder does and does not do for imports
The tool fixes column order. It does not fix names, types, extra columns, or NULL handling — those are separate steps.
| Concern | Handled here? | What to do instead |
|---|---|---|
| Column order vs. schema | Yes | This tool |
| Header names ≠ table column names | No | Rename first with csv-header-rename (only matters for name-binding importers) |
| Export has extra columns | No (all kept) | Remove with csv-column-remover or list columns explicitly in COPY |
| Date / number text formats | No | Standardise with excel-date-standardizer |
| Empty cell → NULL vs empty string | No | Set in your importer's NULL option; the tool keeps empty cells empty |
Tier limits for this tool
Excel-family limits. Column Reorder is Pro-gated. All processing is browser-side.
| Tier | Max file size | Max rows | Files per run |
|---|---|---|---|
| Free | 5 MB | 10,000 | Tool is Pro-gated |
| Pro | 50 MB | 100,000 | 5 |
| Pro + Media | 200 MB | 500,000 | 20 |
| Developer | 500 MB | Unlimited | Unlimited |
Cookbook
Schema-alignment workflows. The header row is the column order; positional importers bind file column N to table column N.
Match a Postgres CREATE TABLE for positional COPY
Your table is users(id, email, full_name, created_at) but the export columns are scrambled. Reorder to the schema order so COPY (no column list) binds correctly.
Table: CREATE TABLE users (id INT, email TEXT, full_name TEXT, created_at DATE); Export (.csv) before: full_name,created_at,id,email Sue Lee,2026-01-04,1042,sue@x.com Reorder to: id, email, full_name, created_at After (.reordered.csv): id,email,full_name,created_at 1042,sue@x.com,Sue Lee,2026-01-04 Import: COPY users FROM 'users.reordered.csv' WITH (FORMAT csv, HEADER true);
SQLite .import binds by position
SQLite's .import maps the first CSV column to the first table column. A wrong order quietly loads the wrong fields; reorder first.
Table: CREATE TABLE orders (order_id, customer, amount); Before: customer,amount,order_id After reorder: order_id,customer,amount sqlite> .mode csv sqlite> .import orders.reordered.csv orders Verify: SELECT * FROM orders LIMIT 3; -- amounts now in amount, not customer
Silent wrong-field load caught by spot-check
Both state and city are text, so a swapped order imports without error — but the data is wrong. Reordering to schema order prevents it; the post-import SELECT confirms.
Table: addresses(id, city, state, zip) Wrong export order: id, state, city, zip → COPY succeeds, no error SELECT id, city, state FROM addresses LIMIT 1; 1 | WY | Leeds <-- city and state swapped! Fix: reorder export to id, city, state, zip, then re-import.
Extra column the table doesn't have
The export includes a notes column the table lacks. Reorder the real columns to the front, push notes to the end, then remove it before a positional import.
Table: products(sku, name, price) Export: name,notes,price,sku Step 1 reorder to: sku, name, price, notes Step 2 csv-column-remover drops 'notes' -> sku,name,price Step 3 COPY products FROM 'products.csv' CSV HEADER;
Excel export aligned and re-saved as CSV for COPY
Your data is an .xlsx. Reorder here (you get an .xlsx back), then save that as CSV in Excel for a CSV-only importer like COPY.
Upload sales.xlsx -> reorder to id, region, total -> download sales.reordered.xlsx In Excel: File > Save As > CSV UTF-8 -> sales.reordered.csv Postgres: COPY sales FROM 'sales.reordered.csv' WITH (FORMAT csv, HEADER true);
Edge cases and what actually happens
Positional importer loads type-compatible columns into the wrong field
Check inputWhen two out-of-order columns share a type (both text, both numeric), a positional import succeeds with no error and silently misplaces the data. There is no warning at load time. Reorder to schema order first and always run SELECT * FROM table LIMIT 5; to confirm placement.
Header names differ from table column names
By designReorder never renames. For name-binding importers (pgAdmin wizard, Workbench), a header of email_addr will not map to a email column no matter how it is ordered. Rename with csv-header-rename first. For position-binding importers, header text is ignored entirely.
Export has more columns than the table
By designThis tool keeps every column. A positional COPY then fails with a column-count mismatch, or maps extras into the wrong fields. Remove surplus columns with csv-column-remover, or give COPY/INSERT an explicit column list so extras are ignored.
Formulas in the export become static values
ExpectedThe engine flattens the sheet to values before reordering, so a = formula imports as its last-calculated result. That is usually what you want for a database load, but recalc the workbook in Excel first if a formula was stale.
Only the first sheet is imported
First sheet onlyA multi-tab workbook is reduced to its first sheet. If your import data lives on a later tab, move it to the front in Excel before uploading, or the wrong sheet's columns will be reordered and downloaded.
Empty cells vs. NULL
PreservedThe tool keeps empty cells empty — it does not convert blanks to NULL. How an empty field loads depends on your importer's NULL setting (e.g. COPY ... NULL ''). Configure that in the importer; reordering does not change it.
Free tier cannot run this tool
Upgrade requiredColumn Reorder is Pro-gated. The free tier shows an upgrade prompt instead of processing. Pro raises limits to 50 MB / 100,000 rows; large database extracts usually need Pro + Media (200 MB / 500,000 rows) or Developer (500 MB, unlimited rows).
Date or number text drifts on import
Check inputReorder copies cell text verbatim; it does not normalise date or number formats. A 04/01/2026 that your database reads as US MM/DD versus UK DD/MM is a format issue, not an order issue. Standardise first with excel-date-standardizer.
First row treated as header but isn't
Check inputRow 1 is always read as the header for naming the reorder list, and HEADER true in your import skips it. If your file has no header row, the first data row becomes the header and one record is lost. Add a header row or set HEADER false accordingly.
Frequently asked questions
Does my database importer care about column order?
It depends. Positional importers — PostgreSQL COPY without a column list, SQLite .import, MySQL LOAD DATA INFILE without a column list — bind file column N to table column N, so order is critical. Name-mapping tools (pgAdmin's wizard, MySQL Workbench) match by header, but pre-ordering the file still makes the mapping faster and less error-prone.
Why did my import succeed but put data in the wrong columns?
Almost certainly a positional bind with the file columns in a different order than the table, where the mismatched columns happened to share a compatible type. The load succeeds with no error and silently misplaces values. Reorder the file to schema order and verify with SELECT * FROM table LIMIT 5;.
How do I find my table's exact column order?
Use \d table_name in psql, DESCRIBE table_name; in MySQL, or PRAGMA table_info(table_name); in SQLite. The order those return is the order your file's columns must be in for a positional import.
My export has columns the table doesn't have — can I drop them here?
No, this tool keeps every column. Push the extras to the end, then remove them with csv-column-remover, or specify an explicit column list in your COPY/INSERT so the extra columns are ignored on load.
Can I rename headers to match the table while reordering?
No. Reordering only moves columns. Rename headers to your table's column names with csv-header-rename first — this matters only for name-binding importers; positional importers ignore header text.
Should I import the .xlsx or convert to CSV?
Most database importers (COPY, .import, LOAD DATA) read CSV. Reorder here — you get an .xlsx back from an Excel upload — then Save As CSV in Excel. If you start from a CSV, the download is already a .reordered.csv.
Does reordering change my data types?
The tool copies cell text exactly; it does not coerce types. Your database applies the column's declared type on import. If a date or number text format is being misread, fix it with excel-date-standardizer before importing, not with the reorder.
Will my customer data be uploaded anywhere?
No. Reordering runs in your browser via SheetJS; the file's contents never reach a server. Only an anonymous processed-file counter is recorded. This keeps PII-laden exports on your machine right up to the database load.
How do I handle empty cells that should be NULL?
The reorder keeps empty cells empty — it does not convert them to NULL. Set the NULL handling in your importer (e.g. COPY ... WITH (FORMAT csv, NULL '')) so blanks become NULL on load.
Can I automate this for a recurring import pipeline?
The browser tool is interactive (arrow controls), so it suits one-off and ad-hoc schema alignment. For a recurring pipeline, define the column order in your import script itself — e.g. COPY users (id, email, full_name, created_at) FROM ... — which makes the load independent of the file's physical order.
What if my workbook has several sheets?
Only the first sheet is read and reordered; other tabs are dropped and the download is a single Sheet1. Move the sheet you are importing to the front in Excel before uploading.
Which tier do I need?
Pro or higher — the tool is Pro-gated and the free tier shows an upgrade prompt. Pro allows 50 MB / 100,000 rows, Pro + Media 200 MB / 500,000 rows, and Developer removes the row limit at a 500 MB file ceiling.
Privacy first
Every JAD Excel tool runs entirely in your browser using SheetJS and ExcelJS. Your spreadsheets, formulas, and data never leave your device — verified by zero outbound network requests during processing.