A transformation pipe converts the input to a different type and returns the new value — the handler receives the transformed type, not the raw string. A validation pipe checks the input against rules and either returns it unchanged or throws BadRequestException. A pipe can do both simultaneously.
Transformation pipe — changes the type or shape of the value; handler receives the new type.
Validation pipe — asserts rules about the value; throws BadRequestException on failure.
A single pipe can both validate and transform — validate first, then return the transformed value.
Built-in transformation pipes: ParseIntPipe, ParseFloatPipe, ParseBoolPipe, ParseUUIDPipe.
Built-in validation pipe: ValidationPipe using class-validator decorators.