Complete UUID decoder for versions 1-8 as specified in RFC 9562.
- β Full support for UUIDv1 through UUIDv8
- β Extraction of all fields as defined in RFC 9562
- β Timestamp conversion to readable format
- β Reconstruction of fragmented timestamps
- β Multiple output formats (human-readable, JSON, CSV)
- β Simple mode for streamlined output
- β Detailed documentation for each field
# Human-readable output (default)
python uuid_decoder.py 6ba7b810-9dad-11d1-80b4-00c04fd430c8
# JSON output
python uuid_decoder.py --json 018e8f54-9b85-7a3a-a123-456789abcdef
# Simple JSON (flat structure, no descriptions)
python uuid_decoder.py --simple --json uuid1 uuid2
# CSV output
python uuid_decoder.py --csv uuid1 uuid2 uuid3 > output.csvpython uuid_decoder.py [OPTIONS] <uuid1> [uuid2] [uuid3] ...| Option | Description |
|---|---|
--json |
Output as JSON format (pipeable to jq) |
--simple |
Simplified output without descriptions or nested objects |
--csv |
Output as CSV format |
-h, --help |
Show help message |
- Default (no options): Human-readable output with all details
--json: Full JSON with nested structure and descriptions--simple --json: Flat JSON structure, essential fields only--csv: Flattened CSV format for spreadsheet import
python uuid_decoder.py 018e8f54-9b85-7a3a-a123-456789abcdefOutput:
UUID: 018e8f54-9b85-7a3a-a123-456789abcdef
Version: 7
Variant: RFC 4122/9562
Type: Unix Epoch time-based UUID
--------------------------------------------------------------------------------
DECODED FIELDS:
--------------------------------------------------------------------------------
unix_ts_ms:
value: 1711801670533
hex: 0x018e8f549b85
bits: 0-47
unix_timestamp: 1711801670.533
datetime_utc: 2024-03-30T12:27:50.533000+00:00
datetime_readable: 2024-03-30 12:27:50.533000 UTC
β Unix timestamp in milliseconds
Entropy bits: 74
python uuid_decoder.py --json 018e8f54-9b85-7a3a-a123-456789abcdefOutput:
[
{
"uuid": "018e8f54-9b85-7a3a-a123-456789abcdef",
"version": 7,
"variant": "RFC 4122/9562",
"type": "Unix Epoch time-based UUID",
"fields": {
"unix_ts_ms": {
"value": 1711801670533,
"hex": "0x018e8f549b85",
"bits": "0-47",
"unix_timestamp": 1711801670.533,
"datetime_utc": "2024-03-30T12:27:50.533000+00:00",
"datetime_readable": "2024-03-30 12:27:50.533000 UTC",
"description": "Unix timestamp in milliseconds"
}
},
"entropy_bits": 74
}
]python uuid_decoder.py --simple --json 018e8f54-9b85-7a3a-a123-456789abcdefOutput:
[
{
"uuid": "018e8f54-9b85-7a3a-a123-456789abcdef",
"version": 7,
"variant": "RFC 4122/9562",
"unix_ts_ms": 1711801670533,
"timestamp_unix": 1711801670.533,
"datetime_utc": "2024-03-30T12:27:50.533000+00:00",
"datetime_readable": "2024-03-30 12:27:50.533000 UTC",
"rand_a": 2618,
"rand_b": 2387828538430180847,
"entropy_bits": 74
}
]Perfect for processing with jq:
python uuid_decoder.py --simple --json uuid1 uuid2 | jq '.[].datetime_readable'python uuid_decoder.py --csv uuid1 uuid2 uuid3 > output.csvCan be imported directly into Excel, Google Sheets, or any CSV-compatible tool.
Based on timestamp since October 15, 1582, and MAC address.
Fields:
time_low,time_mid,time_hi: Timestamp componentsclock_seq: Clock sequence (14 bits)node: MAC address (48 bits)- Reconstructed:
datetime_utc,timestamp_unix
Similar to v1 with local domain and ID fields.
Fields:
local_domain: POSIX UID, GID, or ORGlocal_id: Local identifier- Timestamp and node fields
Deterministic UUID from MD5(namespace + name).
Fields:
hash_md5: MD5 hash value
Completely random with 122 bits of entropy.
Fields:
random_a,random_b,random_c,random_d: Random componentsentropy_bits: 122
Deterministic UUID from SHA-1(namespace + name).
Fields:
hash_sha1: SHA-1 hash value- More secure than v3
Reordered v1 for lexicographic sorting.
Fields:
time_high,time_mid,time_low: Reordered timestampclock_seq,node: Same as v1- Advantage: Natural time-based sorting
Modern time-based UUID with Unix timestamp.
Fields:
unix_ts_ms: Unix timestamp in millisecondsrand_a,rand_b: Random components (74 bits total)- Recommended for new projects
Customizable format for application-specific needs.
Fields:
custom_a,custom_b,custom_c,custom_d: Customizable (122 bits)
# Check UUID version and timestamp
python uuid_decoder.py <uuid># Export multiple UUIDs to CSV for analysis
python uuid_decoder.py --csv uuid1 uuid2 uuid3 > analysis.csv# Parse UUID info in scripts
UUID_INFO=$(python uuid_decoder.py --simple --json $UUID)
VERSION=$(echo $UUID_INFO | jq '.[0].version')# Get creation timestamp from UUIDv1 or UUIDv7
python uuid_decoder.py --simple --json $UUID | jq '.[0].datetime_readable'#!/bin/bash
# Process UUIDs from file
while IFS= read -r uuid; do
python uuid_decoder.py --simple --json "$uuid"
done < uuids.txt#!/usr/bin/env python3
from uuid_decoder import UUIDDecoder
# Decode UUID
decoder = UUIDDecoder("6ba7b810-9dad-11d1-80b4-00c04fd430c8")
result = decoder.decode(simple=True)
print(f"Version: {result['version']}")
print(f"Timestamp: {result['datetime_readable']}")# Extract all timestamps
python uuid_decoder.py --simple --json *.uuid | \
jq -r '.[] | select(.datetime_utc) | .datetime_utc'
# Filter by version
python uuid_decoder.py --simple --json *.uuid | \
jq '.[] | select(.version == 7)'- Quick Start Guide - Get started in 5 minutes
- Field Reference - Complete field documentation
- Examples - Generate sample UUIDs
# Generate examples
python examples.py
# Test decoder
python uuid_decoder.py --json $(python -c "import uuid; print(uuid.uuid1())")This decoder is 100% compliant with RFC 9562:
- β All 8 UUID versions supported
- β Exact field names from specification
- β Correct bit-level extraction
- β Proper timestamp reconstruction
- β Accurate epoch handling (Gregorian/Unix)
- Fast: Pure Python, no external dependencies
- Memory efficient: Processes UUIDs one at a time
- Batch processing: Handle multiple UUIDs in one command
- Python 3.6+
- No external dependencies (uses only standard library)
Public domain - use freely for any purpose.
Made with β€οΈ for the UUID community