CSV to Slack
Slack has no table. A fenced code block with padded columns is the only thing that stays aligned in a message, because it is the only place Slack uses a monospace font. This page produces that block from your CSV, sized so it still reads on a phone and with wide characters measured properly so the columns do not drift.
Try an example loads a small regional sales table, ready to post.
Why a code block is the only option
Slack's message formatting has bold, italic, strikethrough, quotes, lists and code. It has no table. People work around that three ways and two of them are bad.
- Pasting the raw CSV. It renders in a proportional font, so
Widgetandiiiiiiare different widths and nothing lines up. Six columns of commas is unreadable. - Uploading a file. It works, and it costs the reader a click, a download and a spreadsheet. For six rows that is disproportionate, and the numbers are no longer visible in the channel.
- A fenced code block. Monospace, so padding actually aligns, and it appears inline in the conversation. This is the one.
The output is fenced with triple backticks and ready to paste. Slack renders it as a code block, the padding holds, and the numbers are readable in the channel without anyone opening anything.
Worked example
In:
region,product,units,revenue
EU,Widget,1240,50220.00
US,Widget,2115,85657.50
APAC,Gadget,190,45600.00
Out, fences included:
```
region product units revenue
------ ------- ----- --------
EU Widget 1240 50220.00
US Widget 2115 85657.50
APAC Gadget 190 45600.00
```
The dashed rule under the header is what makes the block read as a table rather than as five lines of text. Columns are padded to the width of their widest value, header included, and separated by two spaces, which is enough to be clearly a gap and tight enough to keep the block narrow.
Wide characters, measured properly
This is the detail that separates a table that holds together from one that drifts. In a monospace font, characters from Chinese, Japanese and Korean, and most emoji, occupy two columns rather than one. Count them as one character each, which is what a naive length does, and every row containing one is padded two columns short.
Counted naively Measured properly
city n city n
------ --- ------- ---
東京 1 東京 1
Paris 2 Paris 2
^ drifts ^ holds
Here every character's code point is checked against the ranges the Unicode standard defines as wide, and the padding accounts for it. Any table containing a CJK city name, a Japanese product name or an emoji status column lines up.
The width warning, and why 90 characters
Slack does not wrap inside a code block on desktop, it scrolls. On a phone it wraps, and a wrapped table is not a table: every row breaks in a different place and the columns are gone.
Roughly ninety characters is where that starts on a typical phone in portrait. The page measures the widest line of your block and warns when it goes past that, naming the actual width, so you find out before you post rather than from somebody replying that they cannot read it.
The fixes are the obvious ones: drop a column, shorten the values, or round the numbers. A table with four columns and short labels reads everywhere; one with nine columns of full timestamps reads nowhere.
Two hundred rows, and why the cap is low
The default cap is two hundred rows, much lower than the other paste pages, because Slack truncates long messages and because nobody reads a two-hundred-row table in a chat window anyway. If you find yourself raising it, the honest answer is usually that the table wants to be a file upload or a link.
The cap is a text box, so raise it when you have a reason. A note names the number whenever the output was cut.
Turning the alignment off
Align the columns is on by default and is the whole point. Turning it off gives you the same values separated by two spaces with no padding, which is narrower and does not line up.
That is occasionally what you want for a two-column table where the alignment adds nothing and the padding pushes the block past the width where a phone wraps it.
Frequently Asked Questions
How do I post it?
Copy the output and paste it straight into the Slack message box. The triple backticks are included, so Slack turns it into a code block as you send. If your Slack is set to send on enter, paste and check the preview before sending.
Why does the table look wrong on my phone?
Because the block is wider than the screen and Slack wraps it. The page warns you when the widest line goes past about ninety characters, which is where wrapping starts on a typical phone in portrait. Drop a column, shorten the labels, or round the numbers.
Does it handle Japanese or Chinese text?
Yes, and correctly. Characters from those scripts occupy two monospace columns rather than one, and the padding accounts for it, so a table with a CJK column still lines up. Counting them as one character each, which is what a naive length check does, makes every such row drift.
Can I use a real table instead?
Slack has no table formatting in messages. A code block is the only construct that uses a monospace font and therefore the only one where padding aligns. Canvases support richer layout, but a pasted message does not.
Why is the row cap only two hundred?
Because Slack truncates long messages, and because a two-hundred-row table in a chat window is not something anyone reads. The cap is editable if you have a reason. Past a few dozen rows, a file upload or a link to a dashboard usually serves the reader better.
What happens to a cell with a line break in it?
It becomes a space. A line break inside a cell would start a new line in the code block and break the alignment for every row below it, so the value is flattened. Tabs are treated the same way, for the same reason.
Does anything I paste leave my computer?
No. There is no upload endpoint on this page and no network request in the code that does the work. JavaScript in your own tab reads the text, processes it and hands back the result. Nothing is stored between visits either, so reloading gives you an empty box again. You can confirm it by opening your browser's network panel and watching it stay quiet while you work.
Related
A table that survives a chat window
Free, no account, no upload. Aligned, fenced, and measured so it still reads on a phone.
Back to the converter