The Code Codex
Theme

Table Converter

Convert tables between Excel, CSV, JSON, SQL, Markdown, HTML, YAML and 15 more formats, including code (Python, TypeScript, Go). Sort, pick columns, remove duplicates and transpose before exporting.

The link keeps what is on screen.

The pasted table goes into the share link (after the #, never sent to servers). Very large tables make the link too long for some apps.

Parameters
Input
Input format
Delimiter
Numbers in the input
With 1.234,5 (Excel in many European and Latin American locales), values like 8.500,50 become numbers in the output and when sorting.
Output
Convert to
Data
Docs and wikis
Code
Structure
Indentation
Leading zeros (ZIP codes, IDs, 007) stay as text.
Transform
Letter case
Input table

Paste a table to convert.

How is it calculated?
Every input becomes one table (a header plus rows of text) and every output starts from it, so any format converts to any other. CSV follows RFC 4180 (quotes, doubled quotes and line breaks inside a cell), and the delimiter is detected by which one gives the same column count on the most lines. Excel and Google Sheets copy cells with Tabs between them, so you can paste directly. JSON accepts an array of objects, a 2D array, an object of columns, an object of objects and JSON Lines. An .xlsx is a ZIP of XML files: it is read and written right here, with no libraries, including formulas (the computed value), dates, merged cells and multiple sheets. Transformations never change the pasted text: switching an option off undoes it. In the output, types are decided per column (if one value is not a number, the whole column stays text), numbers with a leading zero stay text, and CREATE TABLE picks INT, DECIMAL, BOOLEAN or VARCHAR by looking at every value in the column.
See the code ↗

Processed in your browser; nothing is sent.

⌨️ Use from the terminal (JSON)

This tool also runs outside the site: the cli.js script uses the same logic as this page and returns the result as JSON. Parameters are the same as this page's URL — copy the command below with the values on screen.

Deno
deno run -q "https://thecodecodex.com/cli.js?tool=table-convert"
Node.js / Bun
curl -s https://thecodecodex.com/cli.js | node --input-type=module - table-convert in=…
ParameterDescriptionDefault
intabela de entrada (texto)—
fromauto | csv | json | markdown | htmlauto
delimseparador da entrada: auto | comma | semicolon | tab | pipeauto
header0 = a primeira linha é dado, não cabeçalho1
decnúmeros na entrada: dot (1234.5) | comma (1.234,5)dot
tocsv | xlsx | json | jsonl | sql | yaml | toml | ini | xml | markdown | html | ascii | latex | jira | mediawiki | asciidoc | rst | python | pandas | typescript | go | php (xlsx sai como arquivo: redirecione com > tabela.xlsx)json
types0 = tudo como texto (JSON, YAML, SQL)1
null1 = células vazias viram null0
odelimseparador da saída CSV: comma | semicolon | tab | pipecomma
shapeestrutura do JSON: objects | arrays | columns | keyedobjects
indent2 | 4 | tab | min2
tblnome da tabela SQLmy_table
dialectmysql | postgres | sqlite | mssqlmysql
multi0 = um INSERT por linha1
create1 = inclui CREATE TABLE0
alignMarkdown/LaTeX: none | left | center | rightnone
pretty0 = sem alinhar colunas / indentar1
rootelemento raiz do XML / nome da lista no TOMLrows
rowtagelemento de cada linha do XMLrow
boxunicode | asciiunicode
typenome do tipo (Go, TypeScript)Row
sheetnome da aba (xlsx)Sheet1
trim1 = remove espaços extras0
empty1 = remove linhas e colunas vazias0
dedupe1 = remove linhas duplicadas0
transpose1 = transpõe0
casenone | upper | lower | titlenone
findtexto a localizar—
replsubstituição—
regex1 = find é expressão regular0
icase1 = ignora maiúsculas ao localizar0
sortíndice (0, 1…) da coluna para ordenar-1
desc1 = ordem decrescente0
colscolunas na ordem desejada, por índice: 2,0,1—

Requires Deno, Node.js or Bun. With Deno the script runs with no permissions: it cannot read files or access the network. Central Bank indicators are from the day the site was published.

More in Development