---
schema_version: "1"
id: 12b9c6b8acd0d41df6ee369d383d9962da883b6e41a74dbd6811eb2ebbbad3b7
title: RPAD
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/platform/264-0-0/customize_functions_rpad.md
canonical_url: https://help.salesforce.com/s/articleView?id=platform.customize_functions_rpad.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 32b7d01780233917fd9e785466765f61acc08dc7e857bc00b065fa6e947ea01e
description: Inserts characters that you specify to the right-side of a text string.
products:
  - Salesforce Platform
  - Security
release: "264"
---
# RPAD

Inserts characters that you specify to the right-side of a text string.

## Use

`RPAD(text, padded_length[, 'pad_string'])` and replace the variables:

- text is the field or expression after which you want to insert characters.
- pad\_length is the number of total characters in the text string that is returned.
- pad\_string is the character or characters to insert. pad\_string is optional and defaults to a blank space.

If the value in text is longer than pad\_string, text is truncated to the size of padded\_length.

## Tips

Ending blank spaces are omitted.

![Field Name Example: Padding Default](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-extend_click-264-0-0-production-enus/5f7d9219-b7b1-4552-8891-f1aba9b289fc/images/icon_example.png)

Field Name Example: Padding Default

`RPAD(Name, 20)` truncates the Name field after 20 characters. For example, if the name is `mycompany.com`, the value returned is “mycompany.com.”

![My Company Example: No Change](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-extend_click-264-0-0-production-enus/5f7d9219-b7b1-4552-8891-f1aba9b289fc/images/icon_example.png)

My Company Example: No Change

`RPAD('my_company.com', 14, 'z')` returns “my\_company.com” without change because it has 14 characters.

![Field Name Example: Padding with a Character](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-extend_click-264-0-0-production-enus/5f7d9219-b7b1-4552-8891-f1aba9b289fc/images/icon_example.png)

Field Name Example: Padding with a Character

`RPAD(Name, 15, 'z')` returns “mycompany.comz” .

![Field Name Example: Truncating](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-extend_click-264-0-0-production-enus/5f7d9219-b7b1-4552-8891-f1aba9b289fc/images/icon_example.png)

Field Name Example: Truncating

`RPAD(Name, 2)` truncates the name after the second character. For example, if the name is `mycompany.com`, the value returned is “my.”