# `LPAD`

**Applies to:** ✅ Data 360 SQL ✅ Tableau Hyper API

Prepends padding to a string on the left to a specified length.

## Syntax

```sql
lpad(<string>, <length> [, fill])
```

## Arguments

### Required

- `<string>`: The string to pad.
- `<length>`: The desired total length.

### Optional

- `fill`: The padding characters. Defaults to space.

## Returns

Returns a text value padded to the specified length.

## Considerations

- If the string is longer than the specified length, it is truncated on the right.
- The fill string is repeated as needed.

## Examples

### Left Pad

Pad a string on the left.

```sql
SELECT lpad('hi', 5, 'xy') AS result;
```

Returns `'xyxhi'`.

## Related Documentation

- [String Types](/docs/data/data-cloud-query-guide/references/dc-sql-reference/string.md)
