Skip to content

Instantly share code, notes, and snippets.

@MarvNC
Last active January 26, 2026 08:00
Show Gist options
  • Select an option

  • Save MarvNC/e601f3603df22f36ebd3102c501116c6 to your computer and use it in GitHub Desktop.

Select an option

Save MarvNC/e601f3603df22f36ebd3102c501116c6 to your computer and use it in GitHub Desktop.
How to Get Your Discord Token From the Browser Developer Console

How to Get Your Discord Token From the Browser Console

New method (contributed by youyoumu)

  • Open the browser console with F12 or Ctrl + Shift + I.
  • Enable mobile device emulation with Ctrl + Shift + M.
  • Paste the following code into the console and press Enter:
const iframe = document.createElement('iframe');
console.log(
  'Token: %c%s',
  'font-size:16px;',
  JSON.parse(document.body.appendChild(iframe).contentWindow.localStorage.token)
);
iframe.remove();

Alternatively, you can just go to the Application tab, then Local Storage, and find the token key under https://discord.com/ after you have enabled mobile device emulation.

Old method

Click to expand
  • Open the browser console with F12 or Ctrl + Shift + I.
  • Go to the network tab
  • Filter by Fetch/XHR
  • Choose a request that isn't an error (if there aren't any, click on a channel or server to trigger some requests.)
  • You'll find your discord token under the request headers -> authorization section. Copy and paste it from there.

image

@orislegit
Copy link

how do I get the discord token from the app, without using a browser

@orca-pet3910YT
Copy link

you cannot

@Jomunyzx
Copy link

Jomunyzx commented Oct 17, 2025

how do I get the discord token from the app, without using a browser

You can use this (it's not directly in the browser), but it will get the token.


import os
import re
import json
import base64
import requests
import datetime
from pathlib import Path
from Cryptodome.Cipher import AES
from win32crypt import CryptUnprotectData

class DiscordTokenGrabber:
    def __init__(self):
        self.appdata = Path(os.getenv("LOCALAPPDATA", ""))
        self.roaming = Path(os.getenv("APPDATA", ""))
        self.regex = re.compile(r"[\w-]{24}\.[\w-]{6}\.[\w-]{25,110}")
        self.encrypted_regex = re.compile(r"dQw4w9WgXcQ:([^\"]*)")
        self.tokens = set()
        self.valid_tokens = {}

        self.grab_tokens()
        self.verify_tokens()
        self.print_tokens()

    def get_master_key(self, path):
        try:
            with open(path, "r", encoding="utf-8") as f:
                return CryptUnprotectData(base64.b64decode(json.load(f)["os_crypt"]["encrypted_key"])[5:], None, None, None, 0)[1]
        except:
            return None

    def decrypt_token(self, buff, master_key):
        try:
            cipher = AES.new(master_key, AES.MODE_GCM, buff[3:15])
            return cipher.decrypt(buff[15:])[:-16].decode()
        except:
            return None

    def grab_tokens(self):
        paths = {
            "Discord": self.roaming / "discord",
            "Discord Canary": self.roaming / "discordcanary",
            "Discord PTB": self.roaming / "discordptb",
            "Chrome": self.appdata / "Google/Chrome/User Data/Default",
            "Brave": self.appdata / "BraveSoftware/Brave-Browser/User Data/Default",
            "Edge": self.appdata / "Microsoft/Edge/User Data/Default"
        }

        for name, base_path in paths.items():
            storage_path = base_path / "Local Storage/leveldb"
            if not storage_path.exists():
                continue

            master_key = None
            if "discord" in name.lower():
                local_state_path = base_path / "Local State"
                if local_state_path.exists():
                    master_key = self.get_master_key(local_state_path)

            for file in storage_path.glob("*.ldb"):
                with open(file, "r", errors="ignore") as f:
                    for line in f:
                        if master_key:
                            for match in self.encrypted_regex.findall(line):
                                token = self.decrypt_token(base64.b64decode(match), master_key)
                                if token:
                                    self.tokens.add(token)
                        else:
                            self.tokens.update(self.regex.findall(line))

    def verify_tokens(self):
        for token in self.tokens:
            response = requests.get("https://discord.com/api/v9/users/@me", headers={"Authorization": token})
            if response.status_code == 200:
                self.valid_tokens[response.json()["id"]] = token

    def print_tokens(self):
        if not self.valid_tokens:
            print("\n[ ✖ ] No discord tokens found\n")
        else:
            print("\n[ ✔ ] Discord tokens found:\n")
            for user_id, token in self.valid_tokens.items():
                creation_time = datetime.datetime.fromtimestamp(int.from_bytes(base64.urlsafe_b64decode(token.split('.')[1] + '=='), 'big') + 1293840000, datetime.UTC).strftime('%Y-%m-%d %H:%M:%S')
                print(f"🔑 {token}\n>  User ID: {user_id}  Time Created: {creation_time}\n")
            print('\n')

if __name__ == "__main__":
    DiscordTokenGrabber()

@orca-pet3910YT
Copy link

you didn't chatGPT it? cuz this looks sus

@Hollowen-rocks
Copy link

you didn't chatGPT it? cuz this looks sus

its 100% chatgpt or ai

@orca-pet3910YT
Copy link

orca-pet3910YT commented Jan 5, 2026

its 100% chatgpt or ai

i also think so :P

@CODER-X-69
Copy link

CODER-X-69 commented Jan 8, 2026

Can anyone know how to make a python script which can run on terminal/Termux and find token by giving Email and password and if need then authentication code.

I try this a lot but not work 😭

This can be universal solution for mobile/pc users to get token.

@CODER-X-69
Copy link

CODER-X-69 commented Jan 8, 2026

Btw guys I also made a python script which find ur token form just email, password and authorisation code. But now problem is discord update it self so now you can't find token form this script which have authorisation code. But stil you can use this and get token on both pc/mobile ( terminal/Termux ) using just email and password. For now i can Only do this much but in future i try to add new discord authorities code support if possible.

You Can Have My Script Form My GitHub Account. It's name is Discord-Token-Grabber.
https://github.com/CODER-X-69/Discord-Token-Grabber

@orca-pet3910YT
Copy link

quit the yap @Hollowen-rocks

@CODER-X-69
Copy link

CODER-X-69 commented Jan 8, 2026

Well yeah this made by my custom LLM. And its's ai generated + i modify it.

@burakacar6
Copy link

Btw guys I also made a python script which find ur token form just email, password and authorisation code. But now problem is discord update it self so now you can't find token form this script which have authorisation code. But stil you can use this and get token on both pc/mobile ( terminal/Termux ) using just email and password. For now i can Only do this much but in future i try to add new discord authorities code support if possible.

You Can Have My Script Form My GitHub Account. It's name is Discord-Token-Grabber. https://github.com/CODER-X-69/Discord-Token-Grabber

AI detected

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment