WEIR

How to Open Your Twitter Archive and Read tweets.js (2026)

Open your Twitter archive in a desktop browser, learn what each file in the data folder holds, and turn tweets.js into a CSV without uploading it.


Published · Updated · 7 min read

Cover image: From ZIP to spreadsheet

To open your Twitter archive, unzip the file you downloaded, then double-click Your archive.html to view it in a desktop browser.

This guide is for you if your X (Twitter) archive won't open, or tweets.js looks like a wall of code. You get the steps, a map of the files, and two ways to get your posts into a spreadsheet.

Here is what you'll see once the ZIP is unzipped:

Your archive.html      ← double-click: opens in your browser
data/
  tweets.js            ← every post, as data
  account.js           ← your username and email
  like.js              ← posts you liked
  direct-messages.js   ← your DMs, so keep this private
  1. Request the archiveSettings and privacy, Account, Your X data.
  2. Download the ZIPX emails you or sends a notification.
  3. Unzip itExtract every file into one folder.
  4. Open Your archive.htmlDouble-click it on a computer.
  5. Make a spreadsheetUse our viewer, or run Python on tweets.js.

Step 1: Request and download your X archive

X's Help Center lists these steps, which work only for the account you're signed in to:

  1. Open Settings and privacy, then Account.
  2. Choose Your X data under Data and permissions, then confirm it's you with a code.
  3. Request your data. X says it "may take a few days" to prepare.
  4. Download the ZIP from the email or notification, signed in to the same account.

Older versions of the app call these menus Your account and Download an archive of your data. X also asks you to confirm your email address before you request it.

Step 2: Unzip the whole archive

Unzip everything before you open X's viewer page, because it reads the folders beside it.

  • On Windows, right-click the ZIP and select Extract All, as Microsoft's guide shows.
  • A Mac unzips it when you double-click. Apple says the folder appears next to the ZIP.
  • iPhones use the Files app: tap the ZIP, and Files makes a folder of its contents.

Then open the new folder, not the ZIP.

Step 3: Open your Twitter archive in a desktop browser

Double-click Your archive.html in the unzipped folder. On Windows it may show as just Your archive, without the .html.

It opens in your browser as a page where you can browse your posts. X's README file inside the archive says to open it "in a desktop web browser."

The same README warns about two limits:

  • It stops at 50GB. In X's words, the page "only works if the archive is less than 50GB."
  • It shows only part of your data. The full set lives in the files in the data folder.

The page is fine for a quick look, but for your whole history in rows and columns, use one of the next two steps.

Step 4: Read your Twitter archive in a free online viewer

Our free Twitter Archive Viewer reads the ZIP inside your browser, so you don't even need to unzip it. We run Weir, which makes it.

0bytes of your archive uploaded
12columns for each post in the CSV

Drop the ZIP on the page, or just data/tweets.js. It reads only your posts files and account.js, for your username, and leaves your DMs, likes and media untouched.

Then you can search every post, show only posts, replies or reposts, and sort by newest, oldest or most liked. Oldest first is a quick way to find your first tweet.

Download CSV saves every match for Excel or Google Sheets, and Download JSON saves the same rows. Each row holds the post's id, time, type, text, likes, reposts, reply details, language, links, media and its link on X, with codes like & cleaned up.

Step 5: Load tweets.js with Python

Each data file is JSON behind one line of JavaScript. This script skips to the first [ and loads the rest. Run it in the folder you unzipped:

import glob, json

tweets = []
for path in glob.glob("data/tweets.js") + glob.glob("data/tweets-part*.js"):
    with open(path, encoding="utf-8-sig") as file:
        text = file.read()
    # Drop "window.YTD.tweets.part0 = " so the rest is plain JSON
    tweets += [item["tweet"] for item in json.loads(text[text.index("["):])]

print(len(tweets), "posts")
print(tweets[0]["created_at"], tweets[0]["full_text"])

We ran it on 22 October 2026 against a small test archive shaped like X's. It printed:

3 posts
Wed Oct 23 09:15:00 +0000 2024 Launch day & coffee: https://t.co/abc

Notice the raw text still has & and a t.co link. Older archives name the file tweet.js, so change the name if yours does.

To save a CSV that Excel opens cleanly, add this:

import csv

def cell(text):  # spreadsheets run text that starts with = + - @
    return "'" + text if text.startswith(("=", "+", "-", "@")) else text

with open("tweets.csv", "w", newline="", encoding="utf-8-sig") as file:
    writer = csv.writer(file)
    writer.writerow(["id", "created_at", "likes", "reposts", "text"])
    for t in tweets:
        writer.writerow([t["id_str"], t["created_at"], t.get("favorite_count"),
                         t.get("retweet_count"), cell(t["full_text"])])

The utf-8-sig setting is what makes Excel show emoji correctly.

What's in the data folder, and why tweets.js looks like code

The data folder is the real archive, with one file for each kind of data. These are the main ones, as X's README described them when we checked in October 2026:

File What it holds
tweets.js Your posts, edits included
account.js Username, email, sign-up date
like.js Posts you liked
follower.js Accounts that follow you
following.js Accounts you follow
direct-messages.js Your one-to-one DMs
deleted-tweets.js Posts you deleted very recently

Photos and videos sit in folders such as tweets_media. Big accounts get extra post files, tweets-part1.js and up, and older archives may name files differently.

Every one of these files starts the same way. Here is the top of tweets.js from our test archive:

window.YTD.tweets.part0 = [ {
  "tweet" : {
    "id_str" : "1849000000000000000",
    "created_at" : "Wed Oct 23 09:15:00 +0000 2024",
    "full_text" : "Launch day & coffee: https://t.co/abc",

That first line is JavaScript, and everything after it is JSON data. So a spreadsheet can't read the file, and a text editor shows code. Remove the window.YTD.tweets.part0 = part and any JSON tool can read it.

If your Twitter archive won't open

  • The page is blank or broken. Unzip everything, then open Your archive.html from the folder.
  • It's over 50GB. X's page won't load it. Our viewer reads only the posts files, so the media doesn't slow it down.
  • The email never came. Check that your email address is confirmed on X, then request the archive again.
  • Excel shows ids like 1.85E+18. Excel rounds long numbers, so use the viewer's url column or import ids as text.
  • A .js file opens in the wrong app. Open it with a text editor such as Notepad, or drop it on our viewer.

When not to use our viewer

  • You want likes, DMs or followers in a sheet. The viewer reads posts only. Adapt the Python to like.js and the other files.
  • The posts aren't yours. X only gives you your own archive. For a public account, see how to download all tweets from a user.
  • You need the photos and videos. The CSV lists image links, but the files themselves sit in the media folders.
  • Live counts matter. Likes and reposts in the archive are frozen at the moment X built it.

FAQ

How do I open a Twitter archive JavaScript file?

Open it in a text editor to read it, or drop it on an archive viewer. It's JSON behind one line of JavaScript, window.YTD.tweets.part0 =. Remove that line and any JSON tool, or the Python above, can load it.

How do I view my Twitter archive on an iPhone?

Tap the ZIP in the Files app to unzip it. X built Your archive.html for desktop browsers, so it may not work well on a phone. Our viewer is built for Safari from iOS 16.4, the first version MDN lists with the unzip feature it uses.

How long does it take to get your Twitter archive?

X's Help Center says it "may take a few days" to prepare. X tells you by email or push notification when it's ready. Download it while you're signed in to the same account.

Is it safe to upload my Twitter archive to a website?

Only to one you trust, because the archive holds your DMs, your email address and more. Read the site's privacy policy before you upload anything. Our viewer reads the file inside your browser, and nothing is sent.

Sources

All checked on 22 October 2026: