# `RPAD`

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

Pads a string on the right to a specified length.

## Syntax

```sql
rpad(<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.
- The fill string is repeated as needed.

## Examples

### Right Pad

Pad a string on the right.

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

Returns `'hixyx'`.

## Related Documentation

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