Your cleaned output will appear here
Paste text above and click Run — or try the demo
How to Redact API Keys
The Risk of Leaked API Keys
A single exposed API key can result in thousands of dollars in unauthorized charges, data breaches, or service compromise. Over 10 million new secrets are leaked in public repositories every year according to industry reports. When you paste code into AI assistants, the same risk applies — your API key is now in the provider's logs. Our tool detects and redacts keys from OpenAI (sk-), AWS (AKIA), Google (AIza), Stripe (sk_live_, rk_live_), and GitHub (ghp_) before you send them anywhere.
How Detection Works
We use prefix-based pattern matching since each major API provider uses a distinctive key format. OpenAI keys start with sk- or sk-proj-, AWS access keys start with AKIA, Google API keys start with AIza, Stripe keys start with sk_live_ or rk_live_, and GitHub personal access tokens start with ghp_. The tool replaces each match with [API-KEY] while preserving the surrounding code structure, so the AI can still reason about your code logic without accessing real credentials.
Beyond API Keys: Other Secrets
The tool also detects credit card numbers with 13 to 16 digits, cryptocurrency wallet addresses for Bitcoin and Ethereum, IBAN banking numbers, and Social Security Numbers. For database connection strings and custom tokens, enable Auto-Redact in Standard mode and manually review any remaining sensitive values. Consider using a dedicated credential manager to avoid having live keys in your code at all — it is the best defense against accidental exposure.
Related Tools
Free tool to redact emails, phone numbers, SSNs, and API keys from text. Runs 100% in browser for privacy.
Anonymize Server LogsSecurely redact IPv4, IPv6, and MAC addresses from server logs before pasting into AI.
Anonymize Clinical NotesRemove dates, emails, phone numbers, and IDs from clinical notes before summarizing with AI.
Clean PDF Text for ChatGPTExtract and clean text from PDFs for ChatGPT. Remove line breaks, page numbers, and headers instantly.