Blog
Wild & Free Tools

UUID Without Dashes — How to Remove Hyphens in Every Language

Last updated: April 2026 4 min read
Quick Answer

Table of Contents

  1. When to Use UUID Without Dashes
  2. Strip Dashes in Every Language
  3. Remove Dashes in SQL
  4. Add Dashes Back to a No-Dash UUID
  5. Frequently Asked Questions

A UUID without dashes is the same 32 hexadecimal characters as a standard UUID — just without the four hyphen separators. Standard: 550e8400-e29b-41d4-a716-446655440000. No-dash: 550e8400e29b41d4a716446655440000. Here is how to produce either format in every major language, and when each is appropriate.

When to Use UUID Without Dashes

The hyphenated format (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx) is the canonical RFC 4122 standard. Use it by default unless a specific system requires otherwise.

Use no-dash format when:

Keep the dashes when:

Strip UUID Dashes in Every Language

// JavaScript
const uuid = crypto.randomUUID().replace(/-/g, '');
// '550e8400e29b41d4a716446655440000'

// Python
import uuid
no_dashes = uuid.uuid4().hex          # built-in .hex property
no_dashes = str(uuid.uuid4()).replace('-', '')  # alternate

# Java
import java.util.UUID;
String id = UUID.randomUUID().toString().replace("-", "");

# C# / .NET
string id = Guid.NewGuid().ToString("N");
// "N" format specifier = no dashes, lowercase
string upper = Guid.NewGuid().ToString("N").ToUpper();

# Go (google/uuid)
import "github.com/google/uuid"
u := uuid.New()
noHyphens := strings.ReplaceAll(u.String(), "-", "")

# PHP
$uuid = str_replace('-', '', (string) Str::uuid());  // Laravel
$uuid = str_replace('-', '', sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x', ...));

# Bash/Shell
uuidgen | tr -d '-'

# PowerShell
[guid]::NewGuid().ToString('N')   # 'N' = no dashes
[guid]::NewGuid().ToString().Replace('-', '')
Sell Custom Apparel — We Handle Printing & Free Shipping

Remove UUID Dashes in SQL

-- PostgreSQL
SELECT REPLACE(gen_random_uuid()::text, '-', '');
-- '550e8400e29b41d4a716446655440000'

-- MySQL
SELECT REPLACE(UUID(), '-', '');

-- SQL Server
SELECT REPLACE(CAST(NEWID() AS VARCHAR(36)), '-', '');
-- or use format specifier (no equivalent in TSQL — use REPLACE)

Important for SQL Server: If you need a GUID without dashes for a stored value, store it as CHAR(32). Note that SQL Server's UNIQUEIDENTIFIER type always stores and displays with dashes — to store without dashes you must use a character type and handle conversion in application code.

Add Dashes Back to a No-Dash UUID String

If you receive a 32-character no-dash UUID and need to restore standard format:

// JavaScript — add dashes back
function addUUIDDashes(s) {
  return s.replace(/^(.{8})(.{4})(.{4})(.{4})(.{12})$/, '$1-$2-$3-$4-$5');
}
addUUIDDashes('550e8400e29b41d4a716446655440000');
// '550e8400-e29b-41d4-a716-446655440000'

# Python
def add_dashes(s):
    return '-'.join([s[:8], s[8:12], s[12:16], s[16:20], s[20:]])

add_dashes('550e8400e29b41d4a716446655440000')
# '550e8400-e29b-41d4-a716-446655440000'

For a quick no-dash UUID right now, the WildandFree UUID Generator generates standard UUID v4 — copy it, strip the dashes with one of the patterns above.

Generate a UUID and Strip the Dashes

Get a UUID v4 in one click — then use any of the patterns above to remove the dashes for your system. No signup, no download, works everywhere.

Open Free UUID Generator

Frequently Asked Questions

Is a UUID without dashes still a valid UUID?

It is the same identifier — same 128 bits, same uniqueness guarantees. Whether it is "valid" depends on the receiving system. RFC 4122 defines the hyphenated format as canonical, but most UUID parsers accept both forms. Python's uuid.UUID() accepts both. PostgreSQL's UUID type accepts both.

What is the N format specifier in C#?

Guid.ToString("N") in C# / .NET produces a 32-character lowercase hex string with no dashes, braces, or parentheses. Other format specifiers: "D" = standard with dashes (default), "B" = with braces {}, "P" = with parentheses (), "X" = hexadecimal with 0x prefix.

Should I store UUID with or without dashes in a VARCHAR column?

If you must use VARCHAR, CHAR(36) with dashes is the standard. CHAR(32) without dashes saves 4 bytes per row — negligible for most tables. The more important choice is whether to use VARCHAR at all vs. a native UUID type (PostgreSQL UUID, SQL Server UNIQUEIDENTIFIER) which both store as 16 bytes regardless of dash format.

Brandon Hill
Brandon Hill Productivity & Tools Writer

Brandon spent six years as a project manager becoming the team's go-to "tools guy" — always finding a free solution first.

More articles by Brandon →
Launch Your Own Clothing Brand — No Inventory, No Risk