Instagram/TikTok Username Extractor
Paste a batch of profile links or raw @handles, one per line or mixed into a paragraph, and get back clean, deduplicated usernames with the platform for each.
About the Instagram/TikTok Username Extractor
Paste any mix of full profile URLs and bare @handles and each line gets scanned for anything that looks like a link first (with or without a protocol, with or without trailing query params like ?hl=en or ?lang=en), using the browser's real URL parser to read the first path segment as the username. Anything left over gets checked against a simple @word pattern so a bare handle typed on its own still comes through. Instagram and TikTok links get their platform tagged automatically from the domain; a plain @handle with no surrounding link is labeled "unknown/generic handle" since there's no way to know which platform it belongs to. Duplicate usernames (case-insensitive) are collapsed to one row, keeping the first casing seen.
Why the browser's own URL constructor is used instead of a single regex
Rather than writing one large regular expression to match every possible link shape, the tool passes each URL-shaped token to new URL() and lets the browser's built-in parser split it into hostname, path, and query string. That's more reliable than regex alone: it correctly separates ?hl=en or any other tracking parameter from the actual path before the username is read, and it throws a catchable error on a malformed token instead of silently matching something wrong. Tokens without http:// or https:// get a scheme prepended automatically before parsing, so a bare instagram.com/natgeo without a protocol still resolves correctly.
Reserved path names are filtered out so they're never mistaken for usernames
Instagram URLs like instagram.com/p/Cxyz123 or instagram.com/reel/abc have the same shape as a profile link β a domain followed by one path segment β but that segment is a post or reel ID, not a username. The tool keeps an explicit list of Instagram's reserved first-path words (p, reel, reels, stories, explore, tv, accounts, directory) and TikTok's equivalents (video, tag, discover, music, live, upload, search), and skips anything matching one of those instead of extracting it as if it were a handle.
TikTok profile links require the @ in the URL path; Instagram's don't
TikTok's real profile URL format is tiktok.com/@username, so the parser specifically checks that the first path segment starts with @ before treating a TikTok link as a profile at all β a link like tiktok.com/video/12345 is correctly ignored since it doesn't start with that character. Instagram profile URLs, by contrast, never include an @ in the path (just instagram.com/username), so that check only applies to the TikTok branch of the parsing logic.
Domain normalization covers TikTok's short-link subdomain too
Before checking the hostname, the tool strips a leading www. or m. (mobile subdomain), and also vm. β the subdomain TikTok uses for its short, shareable video/profile links (vm.tiktok.com/...). Without that normalization step, links copied straight from TikTok's native share sheet would fail to match the plain tiktok.com host check and get silently skipped.
A two-pass extraction keeps link-based and bare-handle matching from double-counting
The scanner first splits the whole input on whitespace and checks each token against a quick "looks like an Instagram or TikTok URL" pattern; anything that parses successfully is added to the results and removed from the text. Only after that pass finishes does it re-scan whatever text remains for standalone @handle patterns. That ordering prevents a username that was already correctly identified and platform-tagged from a URL β say, from instagram.com/@natgeo β from also being re-added a second time as a generic, unlabeled handle once its surrounding link text is stripped out.
Trailing punctuation is trimmed before matching
Each whitespace-split token has trailing characters like commas, periods, parentheses, and semicolons stripped off first, since pasted text often ends a link with punctuation from the surrounding sentence β "check out instagram.com/natgeo." shouldn't leave a stray period stuck to the end of the extracted username.
Frequently Asked Questions
Why does a link to an Instagram post or reel not get extracted as a username?
Links like /p/ (posts) and /reel/ (reels) are checked against a list of Instagram's reserved path names and deliberately skipped, since that path segment is a content ID, not a profile handle.
Why does a bare @handle show up as "Unknown/Generic Handle" instead of Instagram or TikTok?
A standalone @handle with no surrounding link has no domain to identify which platform it belongs to, so the tool honestly labels it as unknown rather than guessing.
Does the tool work with TikTok's short vm.tiktok.com links?
Yes. The vm. subdomain (TikTok's shareable short-link format) is stripped during hostname normalization, the same way www. and m. are, so those links are recognized correctly.
What happens to duplicate usernames in the pasted list?
They're collapsed into a single row. Matching is case-insensitive, but the first casing encountered in the input is the one kept in the results.
Can I paste plain text with links mixed into sentences, not just one per line?
Yes. The extractor splits the entire input on whitespace and checks every resulting token, so URLs and handles embedded inside regular sentences are still detected, with trailing punctuation like commas and periods trimmed off first.
Are these usernames verified against real Instagram or TikTok accounts?
No. The tool only parses the text you paste β it doesn't check whether any extracted username actually exists on either platform.