Omnikit
DevFilesMoneyAll tools
Ctrl K
Dev toolsFile toolsMoney calculatorsAll tools
HomeDeveloper toolsCSP EvaluatorCSP Validator

CSP Validator

dev

Find typos, missing semicolons and invalid sources in a Content-Security-Policy

Runs in your browser. Nothing you type is sent anywhere. Checked against sources on 16 Oct 2026.

A browser does not reject a broken Content-Security-Policy; it quietly ignores the parts it cannot read. A misspelt frame-ancestor, a missing semicolon that turns script-src into a source of default-src, or self written without its quotes all leave the page less protected than it looks. Paste the header and every directive and source is checked against the CSP Level 3 grammar, with the line that is wrong.

Next:
  • Security Headers Generator Choose HSTS, CSP, framing and more, then copy the nginx, Apache or Vercel config
  • SRI Hash Generator Make the integrity hash and script or link tag for a CDN file, or check one

How to use CSP Validator

1

Paste or type your input.

2

Choose the options you need.

3

Press Ctrl+Enter, then copy or download.

How CSP Validator works

A Content-Security-Policy is easy to get subtly wrong, and browsers never complain: a directive they cannot read is ignored. This tool reads the policy exactly as the CSP Level 3 specification says a browser does, then judges it against the findings of Google's 2016 study of real policies.

Severity Examples
High 'unsafe-inline' without a nonce, * or https: in script-src, object-src not 'none', 'strict-dynamic' with no nonce, a missing semicolon, self without quotes
Medium 'unsafe-eval', allowlisted hosts known to serve JSONP or old AngularJS, base-uri open, plain http sources, unknown directives
Low no frame-ancestors, short nonces, obsolete directives, duplicates, 'unsafe-inline' for styles
Note no reporting, report-uri without report-to, sources a strict policy makes browsers ignore

Paste anything. The bare policy, the whole header line, or a <meta http-equiv> tag. Policies delivered in a meta tag cannot use frame-ancestors, report-uri or sandbox, and the tool flags those. A header with several comma-separated policies is split, since each is enforced.

The rest of the article, and all 6 questions about CSP Evaluator, are on the CSP Evaluator page.

Frequently asked questions

Is 'unsafe-inline' in script-src safe?

No. With 'unsafe-inline', any script an attacker manages to inject into the page runs, which is exactly what a Content-Security-Policy exists to stop. Use a nonce or hash for each inline script instead. Once a nonce or hash is present, modern browsers ignore 'unsafe-inline', so keeping it as a fallback for old browsers is harmless.

What does 'strict-dynamic' do in a CSP?

The 'strict-dynamic' keyword lets a script that was trusted through a nonce or hash load further scripts, while host allowlists and https: are ignored by browsers that support it. Combined with a nonce, it gives a policy that is both strict and easy to deploy. Without any nonce or hash, it blocks every script.

What happens when a CSP directive is misspelt?

The browser ignores the directive and logs a console warning, but the rest of the policy still applies, so the page loses that protection silently. A typo such as frame-ancestor instead of frame-ancestors leaves the page open to clickjacking. This tool lists unknown directives and suggests the name you probably meant.

Can a Content-Security-Policy be set in a meta tag?

Yes, with a meta http-equiv tag in the page head, but three directives do not work there: frame-ancestors, report-uri and sandbox. Policies in a meta tag also apply only to content after the tag. Sending the policy as an HTTP response header is the reliable choice; the meta tag suits static hosting without header control.

Sources

  • W3C, Content Security Policy Level 3Parsing, directives, source expressions, fallback and meta-tag limits
  • Weichselbaum et al., CSP Is Dead, Long Live CSP! (ACM CCS 2016, Google Research)Why allowlists are bypassable, and the strict nonce policy
  • MDN Web Docs, Content-Security-PolicyObsolete directives and browser support

Last verified 16 October 2026.

Rates and rules change; check the source before you rely on a figure.

Still stuck? Ask about CSP Evaluator and anybody who knows can answer. No account needed.

More ways to use CSP Evaluator

  • CSP EvaluatorCheck a Content-Security-Policy directive by directive and see how scripts get past it

Same job, other tools: Check IMEI Number Validity – Test a list of IMEIs for a correct Luhn check digit, one per line, and copy the results.

On the related tools: JWT Decoder – Paste a token to read its header, payload and expiry · Passphrase Generator – Three to ten random words you can actually remember.

Related tools

All developer tools
JWT Decoder, Verifier & EncoderDecode any JWT, verify its signature, and sign new tokens, all in your browserPassword GeneratorStrong random passwords and memorable passphrases, generated on your devicePassword Strength CheckerHow long your password would survive an attack, and exactly what makes it weakHMAC GeneratorHMAC-SHA1, SHA-256, SHA-384 and SHA-512 of text or a file, and signature checksBcrypt Hash and VerifyHash a password with bcrypt at cost 4 to 14, or check a password against a hashTOTP Generator and TesterLive authenticator codes from a secret, a QR code for your app, and a code testerCertificate DecoderRead an SSL certificate, CSR or public key: names, dates, key size and fingerprintsIMEI CheckerCheck an IMEI number’s check digit, see its TAC and serial, and look up the phone model
Was this tool helpful?
Omnikit

Small jobs, done in your browser. Free, fast and private. Files are never uploaded.

Files

  • Compress Image
  • Image to PDF
  • Merge PDF
  • Compress PDF
  • PDF to Word
  • Word to PDF

Dev

  • JSON Formatter & Validator
  • Base64 Encode & Decode
  • JWT Decoder, Verifier & Encoder
  • Password Generator
  • UUID Generator
  • Unix Timestamp Converter

Money

  • SIP Calculator
  • EMI Calculator
  • GST Calculator
  • FD Calculator
  • PPF Calculator
  • Lumpsum Calculator
GuidesQuestionsAboutHow we checkLaw library (beta)PrivacyTermsDisclosureContactMore: Exam practice (UGC NET Paper 1)Runs in your browser. Nothing is uploaded. © 2026 Omnikit (theomnikit.com)