JavaScript String_padding Guide
String padding with padStart and padEnd for aligning text, formatting numbers, and fixed-width output. The guide walks through Pad Methods. `str.padStart(targetLen, padStr)` — pad beginning. `str.padEnd(targetLen, padStr)` — pad end. Examples: `"5".padStart(3, "0")` = "005". `"hello".padEnd(8, ".")` = "hello...". `(123).toString(2).padStart(8, "0")` — binary. `"name".padEnd(10)` — align columns. Pad string is truncated if too long. The guide is organized into 1 sections that build on each other, each pairing a prose explanation with runnable code. Related guides: Arrays, Strings, Numbers, Math, Date. This is one of 145 JavaScript guides on JS Reference — see the full list on the guides page. Practice what you learn in the JavaScript playground, and look up any unfamiliar term in the JavaScript glossary.