JavaScript Pad start

padStart() pads the front of a string with a filler until it reaches a target length, returning the padded copy. It is the classic way to zero-pad numbers or align text in columns.

Syntax

str.padStart(targetLength, padString)

Examples

Input Arguments Output
"5" 3, "0" "005"
↳ Zero-pad to width 3.

When to use it

  • Zero-pad numbers, times and IDs.
  • Right-align text in fixed-width output.

Try it live

Type your input and see Pad start transform it instantly.

Pad start()

Type above to see the result…

Want to go further? Chain Pad start with other functions, pipe one output into the next and watch your data transform in the visual Playground.

Related functions

© 2026 Heifara Buval