Secret & API Key Scanner
Paste a config file, a chunk of logs or a git diff - or load local files straight from disk -
and this scanner hunts for the shapes that mean a credential has leaked: AWS key pairs,
GitHub personal access tokens, OpenAI and Anthropic keys, Stripe live keys, Slack tokens,
JWTs, PEM private key blocks, database connection strings with embedded passwords and a
generic catch-all for anything else that looks like secret =
"a-long-value". Every finding is graded by severity, shown with its line number and a
masked value, and paired with the concrete rotation step for that provider.
Scan your text or files
Paste anything that might carry credentials, or add local files (up to 5 MB each). Nothing leaves this page.
Detection pattern reference
Every pattern the scanner runs, what shape it matches and why it matters. Filter to narrow the table.
| Pattern | Severity | Looks like | Why it matters |
|---|---|---|---|
| AWS Access Key ID | High | AKIAIOSFODNN7EXA.. (20 chars) | Identifies an IAM user or role; the half of the pair that names the credential. |
| AWS Secret Access Key | Critical | aws_secret_access_key = "wJalrXUtnFEMI/K7MD.." | Signs AWS requests. Anyone holding it acts as your IAM identity. |
| GitHub Personal Access Token | Critical | ghp_ + 36 alphanumeric | Classic PAT with whatever scopes were ticked - often repo and admin. |
| GitHub Fine-Grained PAT | Critical | github_pat_ + 20+ chars | Repo-scoped token; live until revoked or expired. |
| OpenAI API Key | Critical | sk-proj-AbCdEfGhIjKl.. (sk- also) | Bills your account and reads organisation data. |
| Anthropic API Key | Critical | sk-ant-api- + 20+ chars | Claude console key; admin variants manage the whole org. |
| Google API Key | High | AIza + 35 chars | Unrestricted keys can burn your quota and billing account. |
| Google OAuth Client Secret | High | GOCSPX- + 20+ chars | With the client ID it can impersonate your app in OAuth. |
| Slack Bot / User Token | High | xoxb-123..-AbCd.. | Grants the token's scopes inside your workspace. |
| Slack App-Level Token | High | xapp- + 10+ chars | Workspace-wide scopes - often more powerful than user tokens. |
| Slack Incoming Webhook URL | Medium | https://hooks.slack.com/services/T.. | Anyone with the URL can post into your channels. |
| Stripe Live Secret Key | Critical | sk_live_51HdAbCd.. (rk_live_ also) | Can charge, refund and pay out real money. Same-day incident. |
| Stripe Test Secret Key | Medium | sk_test_51HdAbCd.. | No real money, but probes your integration and test quota. |
| JWT (JSON Web Token) | Medium | eyJhbGci.. . eyJzdWIi.. . sig | Claims are readable base64, not encrypted. Live tokens act as the user. |
| PEM Private Key Block | Critical | -----BEGIN RSA PRIVATE KEY----- | The block below is the key material - full access to what it unlocks. |
| PuTTY Private Key File | High | PuTTY-User-Key-File-2 | Header of a .ppk private key file. |
| Telegram Bot Token | High | 123456789:AA.. (33 chars) | Operates your bot - reads its updates, sends as it. |
| Discord Bot Token | High | key = M..timestamp.hmac | Full control of the bot account. |
| npm Registry Token | High | npm_ + 36 chars | Can publish packages to your scopes - supply-chain risk. |
| PyPI API Token | Critical | pypi- + 40+ chars | Can publish versions of your projects - package takeover vector. |
| Hugging Face Token | High | hf_ + 34 chars | Gated models, datasets and inference quota. |
| Vercel Token | Medium | vercel_ + 20+ chars | Deploys, env vars and project management. |
| DigitalOcean PAT | High | dop_ + 32+ chars | Droplets, volumes and DNS for the account. |
| Azure Storage Account Key | Critical | AccountKey= + 88 base64 chars | Full read/write on every container and blob. |
| Shopify Token | High | shpat_ / shpca_ + 20+ chars | Products, orders and customers in your store. |
| Square Access Token | High | sq0atp- + 20+ chars | Refunds and transaction data. |
| Linear API Key | High | lin_api_ + 40+ chars | Full CRUD on issues and projects. |
| Twilio Account SID | Medium | AC + 32 hex chars | Less sensitive alone; with a leaked auth token it is the full credential. |
| Database Connection String | Critical | postgres://user:pass@host/db | Direct DB access bypassing the app layer. |
| Basic Auth in URL | High | https://user:pass@host/ | Credentials in git remotes, webhook URLs and shell history. |
| Heroku API Key | Medium | heroku_api_key = uuid | Full control of every app in the account. |
| Mailchimp API Key | High | a1b2c3..-us7 | Sends campaigns and reads your subscriber list. |
| SendGrid API Key | High | SG.base64.base64 | Sends email as your domain - a phishing vector when leaked. |
| Generic Credential Assignment | Low | api_key / password / token = "16+ chars" | Catch-all for providers without a known shape. Check by hand. |
What this tool does
Credentials leak in boring ways: a .env file committed to a
public repository, a database URL pasted into a support ticket, a private key block left in
a CI log, an AWS key pair sitting in shell history on a laptop that later gets lost. Each of
those incidents is just text with a recognisable shape, and this scanner is a set of 34
regular expressions tuned to exactly those shapes - the AKIA
prefix of an AWS access key, the ghp_ prefix of a GitHub
token, the three dot-separated base64 sections of a JWT, the
-----BEGIN ... PRIVATE KEY----- banner of a PEM block. For
each hit it grades the severity (a Stripe live key is an incident, a Twilio SID by itself is
a warning), shows you where in the text it appeared, masks the value so your report can be
shared safely, and tells you the exact console page where that credential has to be revoked.
A generic catch-all pattern also flags anything that looks like
password = "something-long" for providers without a known
shape, so the scanner keeps finding things as new key formats appear.
How to use it
- Paste or load. Drop the suspect text into the box - a whole config file, a git diff of a commit you are about to push, or a log excerpt. For files on disk, use "Add local files" (multiple at once, up to 5 MB each); they are read locally by your browser and never uploaded. Not sure what it catches? Hit "Load sample" to see a demo config full of fake-but-recognisable secrets.
- Set the masking level. Partial (default) shows the first four and last four characters - enough to identify which credential it is without re-exposing it. Use full values only when you need to copy the exact key to revoke it, and hidden mode when the report will be read by people who should not see any of it.
- Tune the noise. The minimum-severity filter lets a first pass show only critical and high hits. The ignore list takes comma-separated substrings - add your team's placeholder conventions (for example
sk-test-orchangeme) so known-safe strings stop reappearing in every report. The scanner also detects obvious placeholders on its own and counts them separately instead of alarming you about them. - Scan and triage. Findings are sorted critical-first, each with its file and line number, a masked value, the surrounding context line with the match highlighted, and an expandable note explaining what the credential is and the concrete rotation step. Click through every critical before you do anything else - those are the ones that move money or unlock accounts.
- Export the report. Copy a plain-text report for a ticket or chat, download it as
.txt, or grab the structured.jsonif you want to pipe findings into your incident tooling. Reports honour whatever masking level is selected, so a shared report never carries more than you intended.
Worked example
Say you are about to push a commit that added a
docker-compose.yml and a .env
file. Open a terminal, run git diff HEAD~1 > review.txt,
then paste the diff into this scanner (or select review.txt
directly). The scan returns: one critical database connection string on line 47
(postgres://app:[email protected]/appdb), one critical
Stripe live key in the env block, and one low-severity generic assignment for a
POSTGRES_PASSWORD line. You fix the diff - replace every real
value with an environment variable reference, add the file to
.gitignore, re-scan until the findings list is empty except
for placeholders - and only then push. Because the real values were already in your working
tree, you still rotate the Stripe key and change the database password: a secret that touched
disk unencrypted should be treated as compromised even if it never left the machine.
How it works
The engine is deliberately simple and inspectable: each of the 34 patterns is a regular
expression with a severity, a human description and a remediation note. Scanning runs every
pattern over the text, records each match with its byte offset, then converts offsets to
file and line numbers using a precomputed line-start index so even multi-megabyte inputs stay
fast. Matches that overlap each other are deduplicated by severity - if a specific rule
(say, Stripe live key) and the generic catch-all both fire on the same span, only the
specific one is reported, which keeps the list honest about what each credential actually is.
Before anything is shown as a finding, the value is checked against a placeholder heuristic
(words like example, runs of x,
template syntax such as ${VAR}) and against your ignore list;
values that look like templates are counted separately so they never inflate the alarm count.
All of this is plain JavaScript in the page source - you can read every pattern yourself,
and the whole scan works offline once the page has loaded.
Common mistakes
- Scanning only the file, not the history. A secret removed in a later commit still lives in git history. Run this scanner over
git log -poutput or usegit filter-repoto scrub it - and rotate the key regardless, because history is what forks and mirrors. - Trusting "it's only a test key". Test-mode keys (Stripe
sk_test_, sandbox tokens) can still probe your integration, exhaust quotas, and in several providers are the same string that gets promoted to production. Treat every leaked credential as real until the provider says otherwise. - Deleting the file instead of rotating the key. Removing a secret from disk does nothing for the copies already in logs, backups, chat history or a public mirror. The credential itself must be revoked and reissued - deletion is cleanup, rotation is the fix.
- Pasting the report with full values into a ticket. That re-leaks the secret to everyone who can read the tracker. Keep masking on partial or hidden for anything shared; switch to full only in the moment you copy a value to its revocation console.
- Ignoring the low-severity catch-all. The generic pattern is the least certain, but it is the only one that catches providers without a known shape - and a leaked
passwordassignment in a config file is exactly as dangerous as a named key. Give low findings a ten-second look each. - Scanning after the incident, not before the push. The cheapest time to catch a secret is in your pre-commit workflow, when rotation costs minutes instead of an incident response. This tool is one half of that; pair it with a git hook or CI check for the other.
Privacy
Everything on this page runs in your browser. Pasted text is held in a local variable, files are read with the browser's file reader and processed in memory, and the pattern matching is plain JavaScript executing on this page - no request ever carries your input to a server, nothing is stored, and there are no analytics calls attached to the scanner itself. You can verify it: open your network tab, run a scan, and watch that only this page's own assets load. The page also works fully offline once loaded, which is the strongest proof of all.
Related tools
Suggested
Luke Keam | techgeek.biz