String padStart() and padEnd()Baseline · Widely available
The padStart() and padEnd() methods of strings return a string lengthened to a minimum number of characters by adding characters to the start or end of the string.
Supported in all major browsers for at least 30 months — safe to use without fallbacks. Baseline since Apr 5, 2017. Widely available since Oct 5, 2019.
Browser support
DesktopChrome
1–56Not supported
57+Supportedsince Mar 9, 2017
Current: 155Edge
12–14Not supported
15+Supportedsince Apr 5, 2017
Current: 154Firefox
1–47Not supported
48+Supportedsince Aug 2, 2016
Current: 157Safari
1–9.1Not supported
10+Supportedsince Sep 20, 2016
Current: 27MobileChrome Android
18–56Not supported
57+Supportedsince Mar 16, 2017
Current: 155Firefox Android
4–47Not supported
48+Supportedsince Aug 2, 2016
Current: 157Safari iOS
1–9.3Not supported
10+Supportedsince Sep 13, 2016
Current: 27How to use
This feature is Baseline widely available — use it freely, no fallback needed.
Example
Full syntax and examples are on MDN: padEnd.
Feature detection
JS · check before using
if ("padEnd" in String || ("prototype" in String && "padEnd" in String.prototype)) {
// String.padEnd is available
}Documentation (MDN)
Specification
Usage share
Sub-features
Support for each part of the feature (2). The overall table above shows when the whole feature works.
| Sub-feature | Chrome | Edge | Firefox | Safari | Chrome Android | Firefox Android | Safari iOS |
|---|---|---|---|---|---|---|---|
| String.padEnd | 57 | 15 | 48 | 10 | 57 | 48 | 10 |
| String.padStart | 57 | 15 | 48 | 10 | 57 | 48 | 10 |