---
title: "lpad function in Strata | Oplema"
description: "Pad text on the left with a character until it reaches a set length, such as for fixed-width codes. For example, lpad('hello', 8, '>') returns '>>>hello'."
url: "https://oplema.com/docs/strata/functions/lpad"
updated: "2026-11-04"
---

# lpad

Add a character to the left of text until it reaches a given length. Longer text is cut from the right to that length.

## Try an expression

In [Formula](https://oplema.com/docs/strata/prep/formula), enter the expression and set Output type to **VARCHAR**.

### Expression

```
lpad('hello', 8, '>')
```

### Result

```
'>>>hello'
```

To use your own data, replace the example values with column names. Keep format strings and other options as written.

Try it live in Formula

Result
| id | result |
| --- | --- |
| 1 | \>>>hello |

## Arguments and types

```
lpad(string, count, character)
```

**string**

Text

**count**

Number

**character**

Text

Supported signatures (1)

```
lpad(string: VARCHAR, count: INTEGER, character: VARCHAR) → VARCHAR
```

The result type can depend on the input types. See DuckDB for the full argument rules.

## Things to know

If the first argument is missing, the result is NULL.

## Related functions

[rpad

Add a character to the right of text until it reaches a given length. Longer text is cut from the right to that length.

](https://oplema.com/docs/strata/functions/rpad)[translate

Swap individual characters: each character in the second argument becomes the character at the same position in the third. Characters with no counterpart are removed.

](https://oplema.com/docs/strata/functions/translate)[ilike\_escape

Check whether text matches a LIKE pattern, ignoring uppercase and lowercase. The escape character lets the pattern search for a literal % or \_.

](https://oplema.com/docs/strata/functions/ilike-escape)[left

Return the first characters of text, up to the given count.

](https://oplema.com/docs/strata/functions/left)

[Browse text](https://oplema.com/docs/strata/functions#text) [DuckDB documentation](https://duckdb.org/docs/current/sql/functions/text.html#lpadstring-count-character)

Function metadata from DuckDB, used under the [MIT license](https://github.com/duckdb/duckdb/blob/v1.5.4/LICENSE).
