HTML spellcheck Attribute

Beginner
4 min read
Updated: Oct 2026
3 examples
Live preview

Definition and Usage

The spellcheck global attribute is an enumerated hint that tells the browser whether an element’s text may be checked for spelling errors.

Common on editable controls such as <textarea>, text-like <input>, and contenteditable regions. Browsers are not required to spellcheck even when the value is true.

Baseline · Widely available.

Not deprecated. Stable global attribute across modern browsers (widely since about November 2017).

Privacy tip.

Spellchecking may send text to a third party. Prefer spellcheck="false" on fields that can hold secrets (emails, tokens, personal notes).

HTML Syntax

syntax.html
<element spellcheck=" true | false">

An empty string (spellcheck="" or bare spellcheck where allowed) is treated like true. If omitted, the default is element- and browser-defined and may be inherited from the nearest ancestor with a set state.

Attribute Values

Enumerated values:

ValueDescriptionTry it
true / ""Check for spelling errors when possibleTry it
falseDo not check for spelling errorsTry it
(omitted)Browser / element default; may inheritTry it

Live Preview

Toggle spellcheck on a textarea with intentional misspellings. Click into the field and edit — many browsers underline errors only when checking is on.

Hint only — your OS/browser must support spellchecking for underlines to appear.

Editable field

HTML Examples

Short study snippets. Use Try It Yourself for a live editor.

Example 1 — Textarea: On vs Off

Compare two text areas with the same misspellings.

HTML
<label for="on">Checked</label>
<textarea id="on" spellcheck="true">
This exampull will be checkd fur spellung.
</textarea>

<label for="off">Not checked</label>
<textarea id="off" spellcheck="false">
This exampull will nut be checkd fur spellung.
</textarea>
Try It Yourself

How It Works

  1. spellcheck="true" asks the browser to check spelling when possible.
  2. spellcheck="false" asks it not to check that control.
  3. Edit the text — underlines usually appear after focus/typing, not as a guarantee.
  4. Hint only — support and dictionaries depend on the browser/OS.

Example 2 — Disable Spellcheck on an Input

Turn checking off for codes, usernames, or other non-prose text.

HTML
<label for="code">Invite code</label>
<input id="code" type="text" name="code"
       spellcheck="false"
       autocomplete="off"
       placeholder="e.g. AB12-XY99">
Try It Yourself

How It Works

  1. type="text" is editable, so spellcheck can apply.
  2. false avoids red underlines on codes and short tokens.
  3. Sensitive fields — prefer false for privacy (MDN guidance).
  4. lang still describes language; it does not replace spellcheck.

Example 3 — contenteditable Region

Spellcheck also applies to editable non-form elements.

HTML
<div contenteditable="true" spellcheck="true"
     role="textbox" aria-multiline="true"
     aria-label="Editable note">
  Type a sentense with mispellings here.
</div>
Try It Yourself

How It Works

  1. contenteditable="true" makes the div editable.
  2. spellcheck="true" requests spelling checks on that region.
  3. role + aria-label keep the control clearer for assistive tech.
  4. Non-editable text is usually not spellchecked even with true.

Edge Cases & Pitfalls

Treat spellcheck as a hint, not a guarantee or a validator.

hint

Browsers may ignore true

MDN: browsers are not required to check spelling. OS language packs and settings matter.

edit

Non-editable content usually skipped

Static paragraphs typically are not spellchecked even with spellcheck="true".

inherit

Default can inherit

If omitted, state may follow the nearest ancestor that set spellcheck.

privacy

Sensitive text → false

Enhanced spellchecking can send content off-device. Disable on secrets.

lang

Language is separate

Use lang for language; use spellcheck only for on/off checking.

Browser Support

spellcheck is an HTML global attribute — a hint for spelling checks on editable content.

✓ Baseline · Widely available

spellcheck

Widely available since about November 2017. Actual underlines depend on the browser and OS spellchecker.

96% Global support (approx.)
Google Chrome All modern
Full support
Mozilla Firefox All modern
Full support
Apple Safari All modern
Full support
Microsoft Edge All modern
Full support
Opera All modern
Full support
Samsung Internet Modern
Full support
Internet Explorer Partial / older
Limited
spellcheck Widely supported

Bottom line: Safe to use as a UX hint. Always assume checking is optional, and turn it off for sensitive fields.

Key Takeaways

  • Role: global hint — may check spelling on editable text.
  • Values: true / empty → check; false → do not.
  • Editable only: non-editable nodes are usually skipped.
  • Privacy: use false where text may be sensitive.

One line: spellcheck asks for spelling help — it does not guarantee it.

Frequently Asked Questions

It is a hint telling the browser whether this element’s text may be checked for spelling errors. Browsers are not required to spellcheck even when the value is true.
true (or the empty string) enables checking when possible; false disables it. If omitted, the default is element- and browser-defined and may be inherited from an ancestor.
Usually no. MDN notes that non-editable elements typically are not spellchecked even if spellcheck is true.
Yes. Consider spellcheck=false on fields that may hold sensitive data so content is less likely to be sent to a third-party checker.
No. lang declares the language of the content. Spellcheck decides whether spelling may be checked; dictionaries often follow language settings.
Yes. Editable regions can use spellcheck=true or false the same way as textarea and text-like inputs.

Next: image sources

Continue with the HTML src attribute for media URLs.

src tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

8 people found this page helpful