To export Twitter/X data to Excel, start with the data you already have and keep post IDs and post text as Text. An existing CSV needs a controlled import. A personal X archive may need conversion first. The worked example below gives you both a local converter and an actual workbook to inspect.
Keep the original file unchanged. A spreadsheet can organize records in your source; it cannot add missing posts, impressions or historical measurements.
Choose the data you want in Excel
| Your starting point | Next action | Check before analysis |
|---|---|---|
| A CSV from an existing collection or analytics report | Use the Text/CSV import steps below. | Account, report period, filters, fields and whether one row means a post or a profile. |
| An existing .xlsx workbook | Inspect its ID and content cell types before changing it. | Exact IDs, literal text and how unavailable values were exported. |
| Your personal X archive ZIP | Extract a working copy. Inspect its post-data files, then use the compatible local adapter below. | Wrapper, file parts and fields. Do not assume the ZIP contains tweets.csv. |
| No saved data yet | Request your own archive, or choose a collection method that covers your task. | This conversion guide does not fetch another account's history. |
X describes its personal download as a ZIP with account information in HTML and JSON files. A personal archive, an analytics report and a list of people who liked a post have different contents. Decide which dataset answers your question before combining them.
Convert a supported personal archive locally
The archive format guide explains how to identify the data files. This adapter supports only an assignment such as window.YTD.tweets.part0 = [...], with nested tweet objects, exact string id_str values and nonempty string created_at fields. Inspect your own files. The downloadable example is synthetic teaching data, not a current private export specification.
- Create a new local working folder. Save the Python adapter, archive_to_csv.py there.
- For a first run, save the synthetic input, example-posts.js in the same folder. The .js file is data to read as text. Do not execute it.
- Open a terminal in that folder. With Python 3.10 or later, run the command below. The adapter uses the standard library; it requires no packages or account connection.
python3 archive_to_csv.py example-output example-posts.js
On Windows, use py -3 in place of python3 if that is your Python launcher. The first argument is a new output folder name. The remaining arguments are the explicit input files. A successful teaching run reports five occurrences and four IDs, then creates example-output/posts.csv and example-output/conversion-note.json.
For a compatible personal working copy, use a different output folder and your actual paths. For example:
python3 archive_to_csv.py my-export "working-copy/data/tweets.js"
If the archive has split parts, pass every relevant part from the same snapshot after the output folder. The adapter checks for part numbers starting at zero with no gaps or repeats. That check detects some input mistakes; it does not prove the download contains every post.
The conversion preserves every source occurrence, including repeated IDs. It writes the source filename, one-based record number, exact ID, original timestamp, text and selected like-count data. The text_state and likes_state columns distinguish absent fields, JSON null, empty text and supplied values. Other fields stay in your original archive; this CSV is a selected table, not a replacement backup.
The adapter stops at 10 MiB per file, 20 MiB total or 20,000 records. It also stops on unexpected syntax, numeric IDs, repeated JSON keys, unsupported text controls, overlong cell text or incompatible count values. It keeps line feeds and tabs but rejects carriage returns rather than silently changing them. It reads each supported array into memory. For a different structure or a larger source, choose a reviewed converter suited to that input.
The CSV preserves literal text. It is not safe to double-click as a general spreadsheet file. A post beginning with = remains exactly that string in the CSV. Use the controlled Text import below. The adapter does not run archive JavaScript, upload data or fetch URLs. It refuses an existing output directory, so a second run needs a fresh name.
Import the CSV with explicit column types
In desktop Excel versions that provide Power Query's Text/CSV connector, follow this order. Menu wording differs by edition. Microsoft documents both file import and the Text/CSV settings.
- Open a blank workbook. Select Data → From Text/CSV, or the corresponding Get Data command. Select the CSV through this importer.
- Check the encoding and separator in the preview. For this adapter's output, use UTF-8 and comma. Confirm that column headings line up.
- Choose Do not detect data types where available, then Transform Data. Start with text columns rather than accepting inferred numbers.
- Inspect Applied Steps. If an early Changed Type step converted identifiers or content, remove or edit that step before applying your chosen types. Check the original source values again. Microsoft describes the automatically added type step.
- Keep
post_id,text,created_at_source, source filenames and state columns as Text. Convert only appropriate quantity columns, such as suppliedlikes, to Whole Number. Keep unavailable entries blank and retain their state columns. - For multiline posts, check the source settings if one post becomes several rows. Where the Line breaks control appears, Ignore quoted line breaks keeps a quoted newline within its field. Confirm with the example's two-line post.
- Choose Close & Load. Verify the loaded cells, then save a new .xlsx workbook.
Excel has 15 significant digits of numeric precision. The ID 1000000000000000001 must remain text. Formatting an already rounded number as Text does not restore the original digits; reimport the unchanged source. Use the ID guide for identifier questions beyond this import.
Check post content too. A value such as =SUM(1,2) must appear as literal text, never as the calculated number 3. Quoted CSV fields preserve separators and embedded quotes; they do not, by themselves, prevent spreadsheet formulas. OWASP documents the formula-injection and save/reopen risks. Keep the typed workbook for spreadsheet work and repeat the checks after any later CSV export.
Export an existing Tweet Archivist collection
For a collected archive you own in Tweet Archivist, open that archive, set the intended filters and use its export menu to choose CSV, Excel or JSON. Export access requires an eligible paid account. The current collected-archive export applies filters and caps a single export at 50,000 rows. Record the filter settings and row count; reaching the cap calls for a coverage check.
This export has a preservation limit worth checking: its current spreadsheet export prefixes some formula-like text with an apostrophe and writes absent like, repost, reply and view counts as zero. Those zeros do not let you distinguish an unavailable count from a measured zero. Do not remove leading apostrophes blindly, and retain an original source if exact text or missing-count states matter. The local teaching adapter above has its own explicit state columns; it does not describe the product export's schema.
Check the worked example and your result
Download the checked synthetic .xlsx workbook to inspect the intended cell types and values. The matching CSV is for the explicit Text import procedure, not direct opening. The conversion note records source and output hashes, row counts and field states.
| Check | Expected result | What it catches |
|---|---|---|
| Data rows | 5 occurrences, 4 distinct IDs, 1 repeated occurrence | Missing rows, accidental deduplication or newline splitting. |
| First ID | 1000000000000000001 | Numeric rounding. Compare every digit with the source. |
| First post text | Café ☕, "launch", followed by a line feed and Second line | Encoding, quoting and line-break changes. |
| Second post text | Literal =SUM(1,2) | Unwanted formula evaluation. |
| Text states | 3 present, 1 empty, 1 missing | Blank-looking cells with different source meanings. |
| Like counts | 3 supplied values, including 2 zeros; 1 missing and 1 null | Unknown values being replaced with zero. |
The final row repeats the first post. Keep both occurrences in the source table. If your analysis needs one row per ID, create a separate derived table and document the rule. Check differing payloads before choosing a record to retain; an ID match alone does not show that every field matches.
We ran the local adapter and checked CSV round trips, exact ID and text values, missing states, changed input and rejection cases. We also generated, reimported and inspected the workbook's XML: post text is stored as string cells with no formula records. A second check opened the workbook with headless LibreOffice and exported readable HTML with the exact IDs and literal text. These checks did not test Excel's native interface. The Excel import steps above follow Microsoft's documentation; verify your loaded workbook against the example and source.
For your own result, compare source occurrences and distinct IDs before charting. Inspect an early and recent record, a multiline post and any formula-like text. Retain timestamps as supplied; add a separate parsed-date column with a documented timezone if you need calendar groups. Name a count chart “Posts in this dataset,” unless you have separately established wider coverage.
Save a workbook someone else can trust
Keep the unchanged input, conversion note and typed workbook together in a private working folder. Add the source date, account or collection scope, filters and any exclusions. A source hash identifies the exact input bytes used; it does not certify completeness or accuracy.
If IDs are rounded, return to the source. If accents are broken, check encoding. If extra rows appear, check quoting and newline settings. If a count is unavailable, leave that uncertainty visible. Those checks make the spreadsheet a useful record of the data you actually exported.