Skip to Content
🎉 Rut.ts 3.4.0 is released! Check out Safe Mode and improved API.
DocumentationFeaturesFeatures

Features

Rut.ts provides a comprehensive set of functions for working with Chilean RUTs.

Core Functions

Validation

  • validate() - Check if a RUT is valid with optional strict mode

Formatting

  • format() - Convert RUTs to standardized format
  • clean() - Remove formatting characters

Analysis

  • decompose() - Split RUT into body and verifier
  • getBody() - Extract just the body
  • getVerifier() - Extract just the verifier digit
  • calculateVerifier() - Calculate verifier for a given body

Generation & Detection

  • generate() - Generate random valid RUTs
  • isRutLike() - Quick format check without full validation

Common Features

All functions support:

  • ✅ TypeScript types - Full type safety
  • ✅ Safe mode - { throwOnError: false } returns null instead of throwing
  • ✅ Multiple formats - Works with dots, hyphens, or plain numbers
  • ✅ Leading zeros - Automatically handles and removes them

Function Categories

Last updated on