Skip to the workspace
Pebellslearn by building
Pipes  ›  Lesson

Common Built-in Pipes

Common Pipes 12 minA pipe takes a value in a template and returns a display-ready version of it, and Angular ships ready-made pipes for dates, numbers, currency, percentages, text case and debugging.

angular / Common Built-in Pipes

Explore each scene at your own pace.

01 · The rule

The rule

Common Built-in Pipes

The plant card is technically correct and hard to read: "Tue Mar 03 2026 09:14:00 GMT+0530", "349.5", "0.62". The data is right; its presentation is wrong. You could write formatting methods for each, but Angular already ships them as pipes.

The rule

A pipe changes how a value looks, never what it is.

A pipe sits after a | in a template expression and turns the value on its left into display text:

<h3>{{ plant().name | titlecase }}</h3>
<p>Last watered {{ plant().lastWatered | date:'d MMM' }}</p>
<p>Price {{ plant().price | currency:'INR' }}</p>
<p>Humidity {{ plant().humidity | percent }}</p>

With a name of 'boston fern', a price of 349.5 and humidity 0.62, this shows "Boston Fern", "Last watered 3 Mar", "Price ₹349.50" and "Humidity 62%" (for an English locale). The signal still holds the original values; only the screen changes.

The everyday set, all from @angular/common:

Pipe Class Example output
date DatePipe Mar 3, 2026, or any format you pass
currency CurrencyPipe ₹349.50 with currency:'INR'
number DecimalPipe 3.14 with number:'1.0-2'
percent PercentPipe 62% from 0.62
uppercase, lowercase, titlecase UpperCasePipe etc. Changes letter case
json JsonPipe The object as JSON text, handy for debugging
slice SlicePipe Part of a string or array
async AsyncPipe The latest value of a promise or observable

Arguments follow a colon: date:'d MMM', number:'1.0-2' (at least 1 whole digit, 0 to 2 decimals).

Because pipes are template dependencies, a standalone component must import each class it uses:

imports: [DatePipe, CurrencyPipe, PercentPipe, TitleCasePipe],

Notice that the number pipe's class is DecimalPipe, a common stumble.

Scene 1 of 5
Hover to wake the cannons. Drag to move, or use arrow keys when focused. Press Enter to fire a shot.