Same characters in both fields for a fair comparison.
FormData reads what would be submitted for each name.
hard may include wrap ↵ markers; soft usually stays one continuous string.
Open Try It Yourself to edit the text and re-test.
Edge Cases & Pitfalls
Most confusion is mixing visual wrapping with the submitted string, or forgetting cols for hard wrap.
hard
Always set cols with hard
Without cols, wrap="hard" is invalid. Soft wrap does not require it.
submit
About form data, not CSS
wrap is not a substitute for CSS white-space or overflow-wrap on other elements.
non-standard
off is not portable
Stick to soft and hard for cross-browser HTML. Use CSS if you need a no-wrap look.
js
Reading .value
In script, textarea.value is the live contents. Hard wrap breaks are applied for submission (and FormData), which you can demonstrate by submitting a form.
wrap is an HTML attribute on <textarea>. It is not a Node.js, Deno, or Bun API.
✓ Baseline · Widely available
wrap
soft and hard are widely supported. Prefer those two keywords; treat wrap="off" as non-standard where you encounter it.
96%Global support (approx.)
Google ChromeAll
Full support
Mozilla FirefoxAll
Full support
Apple SafariAll
Full support
Microsoft EdgeAll
Full support
OperaAll
Full support
Samsung InternetAll
Full support
Internet ExplorerSupported
Supported
wrapWidely supported
Bottom line: Safe for everyday forms. Use soft by default; use hard with cols when the server needs fixed-width line breaks.
Remember
Key Takeaways
Role: how textarea values wrap for form submission.
Default:soft — no auto wrap breaks.
hard: insert line breaks; always set cols.
Avoid: relying on non-standard off in new pages.
One line:wrap is about submitted textarea line breaks — soft by default, hard with cols when you need fixed-width breaks.
Frequently Asked Questions
On a textarea, wrap controls how the value is prepared for form submission. soft (default) does not insert extra line breaks. hard inserts CR+LF breaks so each line fits the control width.
soft keeps the typed value as-is (normalizing existing line breaks to CR+LF) without adding wrap breaks. hard automatically inserts line breaks based on the visible width, which requires the cols attribute.
Hard wrap needs a known column width to decide where to insert breaks. The HTML specification requires cols when wrap is hard.
soft and hard mainly affect the submitted string. Visual wrapping while editing is mostly browser/CSS behavior. The non-standard off value (where supported) can make long lines scroll horizontally instead of wrapping.
No. The living HTML Standard defines soft and hard. off appears in some browser docs and MDN as a practical value, but treat it as non-standard.
No. soft and hard are standard, Baseline, and widely available on textarea.