b2KIT

Secret Scanner

Scan text or code for accidentally exposed secrets like API keys, tokens, passwords, and private keys using pattern matching.

Tested tool guide Tested browser tools Checked August 16, 2026

What Secret Scanner does, with a checked example

Paste code, config files, or logs into this tool and it scans the text for strings that match the known formats of real-world credentials: AWS access key IDs, GitHub and Slack tokens, Stripe keys, PEM private-key blocks, and similar. Matching is by shape, not meaning: a string is flagged because it looks like a credential, with the matched value and its location reported so you can act on it. The thing most people get wrong: a clean scan does not mean the text is safe. Formats the scanner has no pattern for pass through silently, and nothing here checks whether a flagged key is real, live, or already revoked.

Worked example

A concrete input and expected output from the current implementation.

Input

GITHUB_TOKEN=ghp_1234567890abcdefghijklmnopqrstuvwxyz

Expected output

GitHub Personal Access Token (classic) detected at line 1 - matched value: ghp_1234567890abcdefghijklmnopqrstuvwxyz

The classic GitHub personal access token format is the prefix ghp_ followed by exactly 36 alphanumeric characters. The value after the equals sign is 40 characters long - the 4-character prefix plus a 36-character suffix - so the GitHub pattern matches it. The scanner reports the match on format alone; it does not check the token against GitHub.

How the result is produced

1

Pattern matching over plain text

The scan runs a library of regular expressions over the pasted text as plain text - comments, string literals, and prose are all treated alike. Each pattern encodes one credential format: a known prefix (such as ghp_ or AKIA), a fixed length, a character set, or a structural marker like a PEM header line. Every hit is reported with the matched value and where it appears in the document.

2

Format matching, not validation

Matching is format-only. The same pattern fires for a live token, a revoked one, and a format-valid sample copied from vendor documentation - the scanner cannot tell which you have. Coverage is also bounded: credentials from new or niche services, or secrets in custom formats, are invisible unless a pattern exists for them. Treat results as leads to check, not verdicts.

Good uses

  • You are about to paste a .env file, a config snippet, or a code block into a public issue, chat, or forum post, and want to catch an API key that rode along inside a string literal or comment.
  • A colleague shared a config dump or deploy log in a ticket; you scan the pasted text to find out which provider credentials it contains before the document circulates further.
  • After a suspected leak you build an inventory: paste each affected file through the scanner to list every credential type present, so you can match them to the accounts that need rotation.

Limits and checks

  • A match proves shape, not exposure. The flagged string may be a revoked key, a test fixture, or a format-valid sample from vendor documentation, and an absence of matches proves even less: secrets in custom or newer formats have no pattern to trip.
  • Matching ignores context. A key inside a comment, a dead code path, or a clearly fake test value is reported the same as one in active configuration, so the report alone does not show whether the credential is actually in use.
  • Scanning does not remediate. The tool finds a secret in text you supplied; it cannot revoke the key, remove it from your files, or undo copies that already left your machine. Remediation means rotating the credential at the provider and deleting the exposed value everywhere it appeared.

Common questions

Does scanning send my text to a server?

No. The scan runs entirely in the browser and nothing you paste is uploaded or stored. The honest caveat: if the text contains a secret that is still valid, the exposure already happened wherever that text previously left your machine; scanning it locally only tells you what is in it.

A match was reported - was my key leaked?

Not necessarily. The match means the text contains a string shaped like that credential type; it could be a live key, a revoked one, a placeholder, or a documented sample. Treat every match as potentially live, rotate the credential at the provider, and remove the string from the text and anywhere it was pasted.

References and verification

The example and behavioral notes were checked against the browser implementation. Standards and primary references below define the relevant format, formula, or platform behavior.

Related Tools