You make a space in HTML with the space character itself, but only when that character sits in a context where the browser preserves it. In ordinary page text, HTML collapses any run of whitespace—spaces, tabs, and line breaks—into a single word gap, so typing extra space characters between two words usually does nothing. To force additional spacing, use   for a non-breaking space, for preformatted text, or CSS such as margin, padding, white-space, and gap for layout. Which of those you need depends on what kind of space you are trying to create.

The core problem: HTML collapses whitespace

HTML is a markup language for describing structure, and its whitespace rules assume that source-code formatting should not affect the rendered page. A browser treats the following three lines as identical output:

All three render as "Hello world," with a single ordinary space between the words. This is not a bug. It lets authors indent markup, break long lines, and format code without accidentally changing the display. The specification's white-space processing rules define this collapsing behavior, and CSS then builds on it.

So the direct answer has a qualification: a single space between words works normally, but multiple spaces, leading spaces, or trailing spaces will be reduced to one space—or removed—unless you actively preserve them.

The non-breaking space:

The most common tool for forcing a space is the character entity  , which renders as a non-breaking space (U+00A0). It does two things at once:

1: It counts as visible whitespace that will not be collapsed together with neighboring spaces in normal text. 2: It prevents a line break at that position, keeping the words on either side together.

For example, if you need several visible spaces in a sentence:

That produces roughly three spaces of gap after "Name:" and keeps that gap intact when the paragraph wraps.

Its second function is genuinely useful. A non-breaking space between a quantity and its unit—10 kg, $5 million—keeps them from being split across lines. The same applies to names or phrases you want to stay intact.

The catch is that   is often abused. Stacking several of them to indent a paragraph, center text, or create columns produces brittle layouts that fail on different screen sizes and are inaccessible to screen readers in ways you do not intend. Use one or two where a fixed, non-breaking gap genuinely matters; use CSS for layout.

A related entity,   (en space) and   (em space), provides wider fixed spaces, but browser rendering of their exact widths varies and is best avoided for precise design. The ordinary   is the reliable workhorse.

Preserving all whitespace with and white-space

If you want every space, tab, and line break in your source to render exactly as typed, use the element:

Browsers render content in a monospace font by default and preserve all whitespace. That makes it well suited to code samples and ASCII diagrams—and poorly suited to ordinary prose, because the monospace font and preserved indentation look out of place on a normal page.

The CSS equivalent is the white-space property. Setting white-space: pre on any element gives it the same preservation behavior without changing the font:

Two related values matter in practice:

white-space: pre-wrap preserves spaces and line breaks but still wraps long lines, which avoids horizontal overflow. white-space: pre-line preserves line breaks but collapses spaces.

There is also white-space: break-spaces, which preserves trailing spaces and allows wrapping at preserved spaces. For most authors, pre-wrap is the sensible default when preserved text must also fit a responsive page.

Spacing between elements: CSS, not space characters

A large share of people asking how to make a space in HTML actually want a gap between blocks—between two paragraphs, between buttons, between a label and an input, or between items in a flex row. Typing space characters between the tags will not do it, because whitespace between block elements is not rendered as a gap.

Use CSS for this. The main tools:

Goal CSS approach
Gap after a block element margin-bottom
Space inside an element around its content padding
Gap between flex or grid items gap
Extra gap above one specific element margin-top

For example, to put space between two paragraphs:

To space out a row of buttons:

The gap property is the cleanest modern solution for flexbox and grid layouts, because it applies uniform spacing without margins on individual children and without collapsing-margin surprises. Margins are still appropriate for spacing between paragraphs and sections in normal document flow.

Indenting text

To indent the first line of a paragraph, use text-indent:

To indent an entire block—such as a blockquote or an aside—use margin-left or padding-left. Reaching for a string of   characters at the start of a line is the classic mistake; it works in a fixed-width preview and breaks the moment the text wraps or the font changes.

Spacing inside inline text

Sometimes you want a visible gap between two inline elements or words without relying on the collapsing rules. Options include:

A single ordinary space in the source, which renders as one space—usually enough.   when the gap must not collapse and must not break. CSS margin or padding on an inline element (though vertical margins do not apply to non-replaced inline elements in the normal way). The word-spacing property to widen all spaces in a run of text:

letter-spacing is sometimes confused with this; it spaces out individual characters, not words.

Common mistakes and why they fail

A few patterns recur often enough to name directly.

Typing many spaces in the editor. They collapse to one. This is the single most common source of confusion.

Using   to fake a multi-column layout or a centered heading. The alignment drifts with font size, zoom level, and screen width. Use flexbox, grid, or text-align: center instead.

Using to create vertical space. A line break is not a space; stacking tags to push content down is a layout hack that behaves unpredictably and is generally replaced by margins.

Expecting spaces between inline-block elements to disappear. The opposite issue exists: a literal newline between two inline-block elements renders as a visible gap, because that whitespace is collapsed to one space rather than removed. If you need elements flush against each other, remove the whitespace in the markup or switch to flexbox.

A quick decision guide

One space between words: type a space. Nothing special needed. Several visible spaces in running text, or a space that must not break:  . Exact preservation of a code block or diagram: or white-space: pre-wrap. Gap between paragraphs, sections, buttons, or grid items: CSS margin, padding, or gap. First-line indent: text-indent. Wider gaps between all words in a passage: word-spacing.

The underlying principle is that HTML handles content and CSS handles presentation. The space character is content; layout spacing is presentation. Once that division is clear, the right tool for any spacing problem becomes obvious.