How to convert a Slack export to CSV or Excel (JSON to spreadsheet)
By Plety. Updated
A Slack export is already JSON: a zip with one folder per conversation and one file per day of messages. To get CSV or Excel, unzip it, read every day file, write one row per message with the conversation, time, sender and text, then open the result in Excel. As of December 2026, Slack's message exports come only as JSON, or TXT for some Enterprise exports.
How do you export Slack to JSON?
Run Slack's own export, because JSON is its standard format. As of December 2026, workspace owners and admins on every plan can export messages and file links from public channels in JSON, from Admin, Workspace settings, Security, Import & export data and the Export tab, choosing a date range. Slack emails a link to the zip file when it is ready.
Private channels and direct messages need an approved application on Business+ or Enterprise; the rules are at https://plety.net/about/guides/how-to-export-slack-direct-messages. Enterprise custom exports can be produced as JSON or TXT. The only CSV on Slack's export page is the channel audit report, a list of channels and their details, not their messages.
What do the JSON files in a Slack export contain?
Each message is a small JSON object, and four fields appear in every one. Slack's guide to reading exports gives them as type, user (the sender's ID), text and ts (the time the message was posted, as a Unix timestamp), and says each message is logged in the file for the date it was sent. The table shows how the common fields map to spreadsheet columns.
| Field | What Slack says it holds | In a spreadsheet |
|---|---|---|
| ts | The time stamp when the message was posted, in Unix time | Convert to a date and time in UTC |
| user | The ID of the member who sent the message | Keep the ID, and add the member's name from users.json |
| text | The text of the message; Slack's formatting guide says mentions are written as <@U012AB3CD> and that &, < and > are control characters written as &, < and > | Keep as one column, and replace mentions and entities if needed |
| subtype | The kind of event, such as bot_message, channel_join, file_share, message_changed or message_deleted | Keep, so joins and bot posts can be filtered out |
| reactions | Each emoji's name, the count and the IDs of members who reacted | Usually left out, or reduced to a count |
| files | Links back to the workspace's files | Usually left out, because the links are not the files |
How do you convert a Slack export to CSV?
A short Python script does it without any paid tool. Unzip the export, save the script below as slack_to_csv.py, and run python slack_to_csv.py followed by the path to the unzipped folder. It reads users.json, or org_users.json on Enterprise, to put a name next to each user ID, then writes one row per message to slack.csv.
The script follows the Python documentation's advice to open CSV files with newline='', which keeps line breaks inside messages intact. It writes with Python's utf-8-sig encoding, which puts a byte order mark at the start of the file; Microsoft says Excel opens a UTF-8 CSV normally if it was saved with that mark. Entries without a ts field, such as content flag records on Enterprise, are skipped.
import csv, json, sys
from datetime import datetime, timezone
from pathlib import Path
root = Path(sys.argv[1]) # the unzipped export folder
names = {}
for ref in ('users.json', 'org_users.json'):
if (root / ref).exists():
for u in json.loads((root / ref).read_text(encoding='utf-8')):
names[u['id']] = u.get('real_name') or u.get('name', '')
with open('slack.csv', 'w', newline='', encoding='utf-8-sig') as f:
out = csv.writer(f)
out.writerow(['conversation', 'time_utc', 'user_id', 'user_name', 'subtype', 'text'])
for day in sorted(root.glob('*/*.json')):
for m in json.loads(day.read_text(encoding='utf-8')):
if 'ts' not in m:
continue # not a message, for example a content flag record
when = datetime.fromtimestamp(float(m['ts']), tz=timezone.utc)
uid = m.get('user', '')
out.writerow([day.parent.name, when.strftime('%Y-%m-%d %H:%M:%S'), uid,
names.get(uid, ''), m.get('subtype', ''), m.get('text', '')])How do you open a Slack CSV in Excel?
Open slack.csv directly, or import it if the characters look wrong. Microsoft's help says a UTF-8 CSV saved with a byte order mark opens normally; otherwise it can be opened from the Data tab with Get Data, From File, From Text/CSV, or with the Text Import Wizard. Save it as a workbook if it will be filtered or edited.
Large workspaces can exceed Excel's limits. Microsoft gives the worksheet maximum as 1,048,576 rows by 16,384 columns, and says a cell can hold up to 32,767 characters. A workspace with more messages than one sheet holds needs one CSV per channel or per year, which means changing the script to open a new file for each folder.
What does a spreadsheet of a Slack export leave out?
A sheet built from the export shows messages, not the full shape of the conversation. Slack's guide to reading exports says the export does not distinguish thread replies from messages sent to a channel, so replies sit in the flow by time. Files are links that direct back to the workspace, and Slack says they stop working if the file, its channel or the workspace is deleted.
Edited and deleted messages appear only if the retention policy kept them, as rows with the subtypes message_changed and message_deleted; Slack's guide says the earlier text sits in a previous field, which the script does not copy. Mentions stay as user IDs in the text column unless they are swapped for names from users.json.
Why does converting a Slack export matter when a company closes or licenses its records?
A spreadsheet of a whole workspace is an easy-to-share copy of everyone's messages, so a company that is closing or licensing its records has reason to keep it inside its own systems and decide early which channels belong in it. Names, emails and other personal details are removed before anything leaves the company, as set out at https://plety.net/about/guides/how-to-anonymise-a-slack-export, and how chat records fit a data licence is at https://plety.net/about/records/team-chat.
Questions
- Can Slack export straight to Excel?
- No. As of December 2026, Slack's export page offers messages as JSON, with TXT for some Enterprise exports, so a spreadsheet comes from converting the JSON.
- Does the script handle direct messages and private channels?
- Yes, if the export includes them. Each conversation has its own folder, named after the channel or, for a direct message, its conversation ID, and the script writes the folder name in the conversation column.
- How is the ts value turned into a date?
- Slack's guide to reading exports says ts is a Unix timestamp that any Unix time converter can translate. The script converts it to a date and time in UTC with Python's datetime module.
Want to know what your records could fetch?
Email Herman or book a 30-minute call. We tell you which buyers fit before anything else happens.
Sources
- Slack Help Center, How to read Slack data exports
- Slack Help Center, Export your workspace data
- Slack developer docs, Formatting message text (mentions and escaping)
- Python documentation, csv module
- Python documentation, codecs module (utf-8-sig encoding)
- Microsoft Support, Opening CSV UTF-8 files correctly in Excel
- Microsoft Support, Excel specifications and limits
This page is general information, not legal advice. Take advice on your own company's records and contracts.
Read next
- How to anonymise a Slack export: files, fields and tools
- What is in a Slack export? Files, folders and format explained
- How to export Slack workspace data, including private channels and DMs
- Licensing team chat (Slack and Teams) to AI buyers
- How licensed business records are delivered: formats, schemas and masking
- Glossary of the terms used here