Format Code Now
/
Web & markupHTML Textarea Generator Next: HTML URL Input Generator ›

HTML Textarea Generator

WM-43

Type a label, set the size and limits, add any starting text, and copy a labelled textarea. Starting text is escaped and its blank lines are kept.

Runs in your browser. Nothing is uploaded.

Key: value lines (label: is required; also name:, rows:, cols:, placeholder:, minlength:, maxlength:, wrap:, required:); other text is the starting content

HTML

How to use it

  1. Write label:, then name:, rows:, cols:, placeholder:, minlength:, maxlength: and wrap: as needed.
  2. Type any starting text on its own lines.
  3. Choose autocapitalize and spellcheck.
  4. Copy the label and textarea.

Size, wrap and limits

rows and cols set the visible size in lines and average-width characters, and CSS usually controls the final size. wrap can be soft, which is the default, or hard. With hard, the browser inserts line breaks into the submitted text at the width of cols, so the attribute is required and the tool refuses hard without it. maxlength and minlength count characters of what was typed, and the browser enforces them on submit. Unless your CSS turns it off, most browsers let the user resize the box.

Content, escaping and line breaks

A textarea holds its starting text between the tags, not in a value attribute, so the tool puts your extra lines there with less-than and ampersand characters escaped. On submission, the browser converts line breaks to CRLF pairs, so a server may see carriage returns that you did not type. The autocapitalize select is a hint for on-screen keyboards, and none is a real choice that turns the behavior off.

Error messages and what to do

MessageWhat it meansFix
Add a "label:" line. An input needs a visible label so screen readers can name it.No label: line was found.Add label: and the visible text.
wrap hard needs a "cols:" line, because the browser wraps the submitted text at that width.wrap: hard was used with no cols.Add cols: or use soft.

Questions people ask

How do I set a default text in a textarea?

Put it between the opening and closing tags. A textarea has no value attribute. Type the text on its own lines in this tool and it is placed and escaped.

How do I limit characters in a textarea?

Use maxlength. The browser stops typing past the limit. minlength sets a lower limit that is checked on submit. Show a counter with script if people need to see how many characters are left, since the attribute only stops extra typing.

What is the difference between wrap soft and hard?

soft sends the text as typed, with only your own line breaks. hard sends it with line breaks inserted at the cols width, so it needs cols. Soft is the default and is right for most forms.

How do I stop a textarea from being resized?

Use CSS resize: none on it. HTML has no attribute for this, and the tool writes no styles. You can also limit it to one direction with resize: vertical, which keeps the box from breaking out of a narrow layout.

What does autocapitalize do on a textarea?

It hints to on-screen keyboards how to capitalize: sentences, words, characters, or none. It does not change the text you receive, and desktop keyboards ignore it.

About this tool

Writes a label and a textarea. Text that is not a key: value line becomes the starting content between the tags, escaped, with blank lines kept. The wrap: line takes soft or hard; hard needs a cols: line, because the browser breaks submitted lines at that width, so the tool refuses hard without it. minlength must not be above maxlength. The autocapitalize select is a hint for on-screen keyboards, and the value none is a valid choice. Users can usually resize a textarea in their browser unless your CSS turns that off. The tool does not count characters for you on the page. Optional lines: id:, class:, title:, lang:, data-* and aria-*.

Format Code Now: free, no ads, no accounts. Your input stays in your browser.