Skip to main content

Hash Generator

Free online tool to generate MD5, SHA-1, SHA-256, SHA-512 hashes.

📝 입력 텍스트

✨ 생성된 해시

MD5128-bit
SHA-1160-bit
SHA-256256-bit ⭐ 권장
SHA-512512-bit

해시 함수는 임의의 크기의 데이터를 고정된 크기의 값으로 변환합니다. 비밀번호 저장, 파일 무결성 검증 등에 사용됩니다. SHA-256이 현재 가장 권장되는 알고리즘입니다.

What is a Hash Function?

A hash function is a one-way function that converts arbitrary-sized data into a fixed-size value (hash). The same input always generates the same hash, and the original data cannot be recovered from the hash.

Key Features

  • 4 Algorithms: MD5, SHA-1, SHA-256, SHA-512
  • Real-time Generation: Hash generated as you type
  • Instant Copy: Copy each hash with one click
  • Multi-language Support: Full UTF-8 support (Korean, Japanese, Chinese, etc.)
  • Recommended Algorithm Display: SHA-256 recommended

Supported Algorithms

MD5 (128-bit) ⚠️

  • Length: 32 characters (hexadecimal)
  • Speed: Very fast
  • Security: Vulnerable - collision attacks possible
  • Use: Checksums, legacy systems
Input: Hello World
MD5: b10a8db164e0754105b7a99be72e3fe5

SHA-1 (160-bit) ⚠️

  • Length: 40 characters (hexadecimal)
  • Speed: Fast
  • Security: Vulnerable - collision attacks possible
  • Use: Git (legacy), checksums
Input: Hello World
SHA-1: 0a4d55a8d778e5022fab701977c5d840bbc486d0
  • Length: 64 characters (hexadecimal)
  • Speed: Medium
  • Security: Strong - currently secure
  • Use: Password hashing, blockchain, digital signatures
Input: Hello World
SHA-256: a591a6d40bf420404a011733cfb7b190d62c65bf0bcda32b57b277d9ad9f146e

SHA-512 (512-bit)

  • Length: 128 characters (hexadecimal)
  • Speed: Slower than SHA-256 (can be faster on 64-bit systems)
  • Security: Very strong
  • Use: High security requirements
Input: Hello World
SHA-512: 2c74fd17edafd80e8447b0d46741ee243b7eb74dd2149a0ab1b9246fb30382f27e853d8585719e0e67cbda0daa8f51671064615d645ae27acb15bfb1447f459b

Use Cases

1. Password Storage (SHA-256 + Salt)

const password = 'myPassword123';
const salt = generateRandomSalt(); // UUID etc
const hash = sha256(password + salt);

// Store in database
// { username: 'user1', hash: '...', salt: '...' }

⚠️ Note: In practice, use dedicated algorithms like bcrypt, argon2!

2. File Integrity Verification

# Check hash of downloaded file
$ sha256sum ubuntu-22.04.iso
a591a6d40bf420404a011733cfb7b190d62c65bf0bcda32b57b277d9ad9f146e

# Compare with official hash

3. API Signature

const data = { userId: 123, amount: 100 };
const secret = 'api-secret-key';
const signature = sha256(JSON.stringify(data) + secret);

// Include in request header
// X-Signature: a591a6d40bf420404a011733cfb7b190...

4. Git Commit ID

# Git uses SHA-1 (unique ID for each commit)
$ git log --oneline
a591a6d Fix bug in login
b10a8db Add new feature

5. Cache Key Generation

const cacheKey = md5(`user:${userId}:profile`);
cache.set(cacheKey, userData);

Hash Collision

What is Collision?

When different inputs generate the same hash:

input1 ≠ input2
hash(input1) = hash(input2) ← Collision!

Collision Resistance by Algorithm

AlgorithmCollision ResistanceStatus
MD5❌ Very weakCollisions found since 2004
SHA-1❌ WeakReal collision published in 2017
SHA-256✅ StrongCurrently secure
SHA-512✅ Very strongCurrently secure

Collision Probability

For SHA-256:

  • Possible hashes: 2^256 ≈ 1.16 × 10^77
  • 50% collision probability with birthday paradox: 2^128 attempts needed
  • Practically impossible!

Programming Language Examples

JavaScript (Browser)

async function sha256(text) {
const encoder = new TextEncoder();
const data = encoder.encode(text);
const hash = await crypto.subtle.digest('SHA-256', data);
const hashArray = Array.from(new Uint8Array(hash));
return hashArray.map(b => b.toString(16).padStart(2, '0')).join('');
}

const hash = await sha256('Hello World');

JavaScript (Node.js)

const crypto = require('crypto');

const hash = crypto.createHash('sha256')
.update('Hello World')
.digest('hex');

Python

import hashlib

# SHA-256
hash_sha256 = hashlib.sha256('Hello World'.encode()).hexdigest()

# MD5
hash_md5 = hashlib.md5('Hello World'.encode()).hexdigest()

PHP

<?php
// SHA-256
$hash = hash('sha256', 'Hello World');

// MD5
$hash = md5('Hello World');
?>

Security Best Practices

✅ Correct Usage

1. Password Storage (Salt + Hash)

const bcrypt = require('bcrypt');

// Hash password
const hash = await bcrypt.hash(password, 10);

// Verify
const isValid = await bcrypt.compare(password, hash);

2. API Signature Verification

const expectedSignature = sha256(payload + secret);
if (receivedSignature === expectedSignature) {
// Valid request
}

❌ Incorrect Usage

1. Simple Hash Only for Passwords

// Wrong!
const hash = md5(password);

// Vulnerable to rainbow table attacks

2. Using MD5 for Security

// Wrong!
const signature = md5(data + secret);

// Collision attacks possible

Hash vs Encryption

Hash

  • One-way: Cannot be decrypted
  • Fixed length: Regardless of input size
  • Deterministic: Same input → same output
  • Use: Integrity verification, password storage

Encryption

  • Two-way: Can be decrypted
  • Variable length: Proportional to input
  • Non-deterministic: Different output each time
  • Use: Data protection, communication security

Frequently Asked Questions

Q: Can I use MD5?

Never for security purposes. Only use for checksums or non-security purposes.

Q: Can I store passwords with hash?

Simple hash is not secure. Use bcrypt, argon2, scrypt dedicated algorithms.

Q: SHA-256 or SHA-512?

  • SHA-256: Sufficient for most cases, widely used
  • SHA-512: Stronger but may be slower (can be faster on 64-bit systems)

Generally SHA-256 recommended!

Q: Can hashes be decoded?

No. Hashing is a one-way function. However, weak passwords can be guessed with rainbow tables.

Q: Can the same hash occur?

Theoretically possible (pigeonhole principle), but practically impossible for SHA-256.

🔗 Try These Next

💬 Was this tool helpful?

Feel free to send us your feedback or suggestions anytime!

Browser Compatibility

This tool uses the Web Crypto API:

  • Chrome (all versions) ✓
  • Firefox (all versions) ✓
  • Safari 11+ ✓
  • Edge (all versions) ✓

Privacy

This tool operates entirely on the client side. Your input data is never sent to a server and is processed only in your browser.