---
schema_version: "1"
id: 0c4a3b4d39870a52f3f87d738af5e1719eeaa5f21de924fff27d06ae8ca49b9e
title: RPAD
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/data-cloud/data-cloud-query-guide/references/data-cloud-sql-reference/scalar-func/string-func/rpad.md
canonical_url: https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/rpad.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: b18bf4e9263dded2943d5e1c1515845ef8dcf28137e68627b6b8a8657b2902f9
products:
  - Data 360 Query Guide
  - Data 360 Developer Documentation
---
# `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](https://developer.salesforce.com/docs/data/data-cloud-query-guide/datatype/string.md)
