A Twitter ID finder turns an X (Twitter) username into the account's numeric user ID. The official way is the X API's user lookup endpoint, which returns the ID for any public username, and a second endpoint converts an ID back into the current username. The ID matters because it never changes: X says usernames are unique but subject to change, while the ID is the account's permanent identifier.
You need a user ID when you're building a tool, tracking an account over time, filling in an ad platform or analytics setting, or checking whether a renamed account is the same one you followed before. Here's how the IDs work, the honest ways to find one, and what to watch out for.
What an X user ID is
X's developer documentation says every object in the X API, including posts, users, lists and DMs, has a unique ID. IDs are 64-bit unsigned integers generated by a system called Snowflake, which encodes a timestamp and the server that created it. That makes IDs roughly time-ordered: higher IDs generally mean newer objects, and X notes that older accounts have shorter IDs.
X's own example in its docs is the XDevelopers account, whose ID is 2244994945. However many times the handle changes, that number stays with the account.
Why the ID beats the username
X's data dictionary is clear on this. The id field is described as the unique identifier of the user, and the username field as the handle the user identifies themselves with, unique but subject to change, typically a maximum of 15 characters. So if you store usernames in a spreadsheet or a CRM, a rename quietly breaks your records. Store the ID and you'll always find the account.
That's also the reason people search for an ID finder after a brand renames its handle. If you're thinking about doing that yourself, read how to change your Twitter username without losing followers first.
Method 1: the official X API (most reliable)
The user lookup endpoints in X API v2 do exactly this job. You'll need a developer account with a Project and App in the Developer Console, which gives you a bearer token to authenticate requests.
- Create a Project and App in the X Developer Console and copy your bearer token.
- Send a GET request to /2/users/by/username/ followed by the handle, without the @ sign.
- Read the id field in the response. X returns it as a string by default.
- To go the other way, send a GET request to /2/users/ followed by the ID, and read the username field.
- For a batch, use /2/users/by with up to 100 usernames, or /2/users with up to 100 IDs, in one request.
| Endpoint | What it does |
|---|---|
| GET /2/users/by/username/:username | Username to user details, including ID |
| GET /2/users/by | Up to 100 usernames at once |
| GET /2/users/:id | ID to user details, including current username |
| GET /2/users | Up to 100 IDs at once |
| GET /2/users/me | Details of the authenticated user, so your own ID |
API access isn't free at every level, so check the current X API plans before you build anything that runs at scale.
Method 2: web lookup tools
Plenty of free websites call themselves a Twitter ID finder: you paste a handle and they show the number. Most of them run the same API lookup on your behalf. They're fine for a one-off check of a public account, but they can break whenever X changes its API access, and some ask you to log in with your X account. You don't need to grant any account access just to look up a public ID, so close any tool that asks.
Method 3: the page code
Some guides tell you to open a profile, view the page source and search for the ID. It can work, but X changes its page code often, so it's the least reliable method and I wouldn't build a process on it.
A developer gotcha: precision
If you work with IDs in code, X warns that JavaScript integers are limited to 53 bits, so large 64-bit IDs lose precision if you treat them as numbers. The fix is simple: API v2 returns IDs as strings by default, and in the older v1.1 API you should always use id_str. Store IDs as strings or 64-bit integers in your database.
Want AI doing the heavy lifting in your marketing?
I build the systems that handle the boring 80 percent, so you get your week back. Done properly, with the human kept in.
The privacy catch
An ID cuts both ways. Because it survives renames, changing your handle doesn't hide your account from anyone who saved the number, and archives or tools keyed on IDs will still connect the old and new names. If you're trying to separate yourself from an old identity, a rename alone won't do it. For your own business account, think about what you've posted under every handle you've used.
And as a researcher, stick to public accounts and public data. Looking up an ID is harmless; building a profile of a private person from it isn't something I'd ever recommend.
My advice
If you need one ID once, a reputable lookup site is fine, as long as it doesn't ask you to log in. If IDs are part of your workflow, use the official user lookup endpoint, store the ID as text next to the username, and refresh the username from the ID now and then. That way, when an account renames, you'll know straight away rather than losing track of it.
For the rest of the series, see the Twitter (X) Help: 21 Guides to Features, Verification, Video Fixes and Tools.
Frequently asked questions
How do I find a Twitter user ID?
Use the X API v2 user lookup endpoint /2/users/by/username/ with the handle. The response includes the account's id field. Free web lookup tools do the same thing for public accounts.
Can I find a username from a Twitter ID?
Yes. The /2/users/:id endpoint returns the user's details for that ID, including the current username.
Does a Twitter ID change when the username changes?
No. X's data dictionary describes usernames as unique but subject to change, while the ID is the account's unique identifier and stays the same.
Why is my Twitter ID shorter than other people's?
X IDs are roughly time-ordered, and X notes that older accounts have shorter IDs.
Is it safe to use a Twitter ID finder website?
For a public account, a lookup is usually harmless. Don't log in with your X account or grant access to a tool just to find an ID, because it isn't needed.