Generates random values — strings, numbers, alphanumeric codes, or floating-point numbers. Useful for creating unique identifiers, random codes, and test data.
Copy {% assign code = "alphanumeric" | random: 8 %}
{% log code %}
Copy {{ type | random }}
{{ type | random: length }}
{{ type | random: length , downcase }} Alphanumeric string
Generates a random string of letters and digits.
Copy {{ "alphanumeric" | random: 8 }} Number of characters (1–20, default: 5)
Set to true for lowercase only
Copy {% assign code = "alphanumeric" | random: 10 %}
{% log code %} Output: aB3xK9mP2n
Copy {% assign code = "alphanumeric" | random: 6 , true %}
{% log code %} Output: k3m8p2
Number
Generates a random integer with the specified number of digits.
Number of digits (1–20, default: 5)
Output: 7284
String (letters only)
Generates a random string of letters only (no digits).
Number of characters (1–20, default: 5)
Set to true for lowercase only
Output: KmPxBnTr
Float / Decimal
Generates a random floating-point number within a range.
Minimum value (default: 0)
Maximum value (default: 1)
Output: 47.382917
Generate a unique order reference:
Generate a discount code:
Generate a random verification PIN:
Generate a random price for testing:
Maximum length for strings and numbers is 20 characters/digits
"float" and "decimal" are interchangeable — both generate floating-point numbers
Random values are not cryptographically secure — do not use for passwords or security tokens
For secure hashing, use hmac_sha256 or sha1 instead