Skip to content

In code

Generate a UUID in Ruby

SecureRandom.uuid ships with Ruby's standard library.

Ruby example

Ruby
require "securerandom"

id = SecureRandom.uuid

No install? Use the tool or API

Here's a fresh version 4 UUID generated right now — copy it, or call the API from any language.

fd412a3c-0cd5-44b2-9989-25ca0a7b4088
curl https://getuuid.sh/api/uuid

Other languages

← Full API reference