--- title: letter-spacing slug: Web/SVG/Attribute/letter-spacing translation_of: Web/SVG/Attribute/letter-spacing ---
{{SVGRef}}

The letter-spacing attribute controls spacing between text characters, in addition to any spacing from the {{SVGAttr("kerning")}} attribute.

If the attribute value is a unitless number (like 128), the browser processes it as a {{cssxref("length")}} in the current user coordinate system.

If the attribute value has a unit identifier, such as .25em or 1%, then the browser converts the <length> into its corresponding value in the current user coordinate system.

Note: As a presentation attribute, letter-spacing can be used as a CSS property. See the {{cssxref("letter-spacing", "CSS letter-spacing")}} property for more information.

As a presentation attribute, it can be applied to any element but it has effect only on the following eight elements: {{SVGElement("altGlyph")}}, {{SVGElement("text")}}, {{SVGElement("textPath")}}, {{SVGElement("tref")}}, and {{SVGElement("tspan")}}

<svg viewBox="0 0 400 30" xmlns="http://www.w3.org/2000/svg">
  <text y="20" letter-spacing="2">Bigger letter-spacing</text>
  <text x="200" y="20" letter-spacing="-0.5">Smaller letter-spacing</text>
</svg>

{{EmbedLiveSample("topExample", "200", "30")}}

Usage notes

Value normal | {{cssxref("length")}}
Default value normal
Animatable Yes

For a description of the values, please refer to the CSS letter-spacing property.

As of May 2019, Firefox ignores letter-spacing and renders text without.

Specifications

Specification Status Comment
{{SpecName("CSS3 Text", "#letter-spacing-property", "letter-spacing")}} {{Spec2("CSS3 Text")}} SVG 2 just refers to the definition in CSS Text 3.
{{SpecName("SVG1.1", "text.html#LetterSpacingProperty", "letter-spacing")}} {{Spec2("SVG1.1")}} Initial definition

Browser compatibility

{{Compat("svg.attributes.presentation.letter-spacing")}}

See also