惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

L
LangChain Blog
阮一峰的网络日志
阮一峰的网络日志
WordPress大学
WordPress大学
博客园 - 司徒正美
罗磊的独立博客
D
Docker
Last Week in AI
Last Week in AI
爱范儿
爱范儿
M
MIT News - Artificial intelligence
V
V2EX
Google DeepMind News
Google DeepMind News
小众软件
小众软件
Apple Machine Learning Research
Apple Machine Learning Research
Microsoft Security Blog
Microsoft Security Blog
T
Tailwind CSS Blog
MyScale Blog
MyScale Blog
V
Visual Studio Blog
博客园 - 叶小钗
B
Blog RSS Feed
A
About on SuperTechFans
F
Fortinet All Blogs
T
The Blog of Author Tim Ferriss
Martin Fowler
Martin Fowler
P
Proofpoint News Feed

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Why Your Computer Reads Numbers Backwards: Byte Order Exp...
hassaan-syed · 2026-05-17 · via DEV Community

What is Byte Order?

Before understanding byte order, we need to understand one thing:

A byte = 8 bits

Many data types use multiple bytes.

For example:

Data Type   Size
char           1 byte
short          2 bytes
int            4 bytes
long long      8 bytes

Enter fullscreen mode Exit fullscreen mode

When a number takes multiple bytes, the computer has to decide:

“In what order should I store these bytes in memory?”

That storage order is called:

Byte Order (Endianness)
1.little order endian
2.big order endian

Most people assume memory stores it like this:

12 34 56 78

But here comes the surprise…

On many computers, it is actually stored like this:

78 56 34 12

Wait… what?

Did the computer reverse the number?

No. Your computer is not confused — this behavior is called Byte Order, also known as Endianness.

In this article, we’ll understand byte order from scratch using diagrams, memory examples, and a practical C program.

*Understanding With an Example
*

Let’s take this hexadecimal number:

0x12345678

This number contains 4 bytes:

12 34 56 78

Now imagine memory locations like this:

Address → 1000 1001 1002 1003

The question is:

Which byte should be placed first?

This is where endianness comes in.

Type 1: Little Endian

In Little Endian, the smallest byte (Least Significant Byte) comes first.

Memory stores:


Address →   1000   1001   1002   1003
Data    →    78      56      34      12

Enter fullscreen mode Exit fullscreen mode

Here:

78 is stored first
12 is stored last

Enter fullscreen mode Exit fullscreen mode

This may look backward, but internally it helps processors perform arithmetic efficiently.

Why is it called “Little” Endian?

Because the little end (least significant byte) is stored first.

Type 2: Big Endian

In Big Endian, the largest byte (Most Significant Byte) comes first.

Memory stores:


Address →   1000   1001   1002   1003
Data    →    12      34      56      78

Enter fullscreen mode Exit fullscreen mode

This looks more natural because humans usually read numbers from left to right.

Why is it called “Big” Endian?

Because the big end (most significant byte) comes first.

Visual Comparison
Number = 0x12345678


Little Endian
┌───────┬───────┬───────┬───────┐
│  78   │  56   │  34   │  12   │
└───────┴───────┴───────┴───────┘
 1000    1001    1002    1003


Big Endian
┌───────┬───────┬───────┬───────┐
│  12   │  34   │  56   │  78   │
└───────┴───────┴───────┴───────┘
 1000    1001    1002    1003

Enter fullscreen mode Exit fullscreen mode