ข้อความ
Text Reverse
กลับข้อความ: ตามตัวอักษร ตามคำ (ลำดับคำ) หรือตามบรรทัด (ลำดับบรรทัด)
This tool reverses text three different ways: by character (letters run in reverse order), by word (words swap places but stay intact), or by line (line order is flipped).
How to use it
- Pick a mode — by character, by word, or by line — depending on the result you need.
- Paste text and the result updates instantly as you type.
- Character mode correctly handles composite emoji and grapheme clusters without breaking them apart.
Common uses
- Creating mirrored text for a design or a puzzle.
- Flipping the order of lines in a list or log without reordering them by hand.
- Checking whether a string is a palindrome — text reversed by character is compared against the original.
Things to keep in mind
A naive reversal by Unicode code point breaks composite characters (emoji with modifiers, some languages' combining diacritics) — a correct implementation splits text into grapheme clusters rather than individual code points.
Word-mode reversal doesn't change the letter order inside each word — it only rearranges the words themselves, not a character-level reversal.
บทความเกี่ยวกับเครื่องมือนี้: การกลับข้อความ: ทำไมจึงพังกับอิโมจิ
คำถามที่พบบ่อย
โหมดการกลับด้านมีแบบใดบ้าง?
มีสามโหมด: กลับลำดับอักขระ, กลับลำดับคำโดยคงแต่ละคำไว้ครบถ้วน หรือกลับลำดับบรรทัดโดยคงแต่ละบรรทัดไว้ครบถ้วน
ทำไมการกลับด้านระดับอักขระอาจให้ผลลัพธ์ที่อ่านไม่ได้?
การกลับข้อความทีละอักขระอาจทำลายลำดับ Unicode แบบหลายไบต์ อีโมจิ หรืออักขระผสม ทำให้เกิดการแสดงผลที่เสียหายทางสายตา; การกลับระดับคำหรือบรรทัดไม่มีปัญหานี้เพราะย้ายทั้งบล็อกข้อความ
ข้อความที่ป้อนถูกส่งไปยังเซิร์ฟเวอร์หรือไม่?
ไม่ การกลับด้านเกิดขึ้นทั้งหมดในเบราว์เซอร์ด้วย JavaScript โดยไม่มีการส่งไปยังเซิร์ฟเวอร์
grapheme cluster คืออะไร?
คือสิ่งที่มนุษย์รับรู้ว่าเป็น "อักขระที่มองเห็นหนึ่งตัว" แม้ว่าใน Unicode บางครั้งมันจะประกอบขึ้นจากหลาย code point — เช่น อีโมจิครอบครัวประกอบขึ้นจากอีโมจิเดี่ยวหลายตัวที่เชื่อมกันด้วยอักขระตัวเชื่อมพิเศษ การกลับข้อความที่ถูกต้องต้องเก็บ cluster เหล่านี้ไว้ด้วยกันเป็นหน่วยเดียว
สามารถกลับด้านอีโมจิให้ยังคงถูกต้องได้หรือไม่?
ได้ หากการกลับด้านแบ่งสตริงเป็น grapheme cluster ก่อนเปลี่ยนลำดับ ไม่ใช่แบ่งเป็น code point แต่ละตัว — เมื่อนั้นอีโมจิที่ประกอบขึ้นจากหลายส่วน (ตัวปรับโทนสีผิว ธงประเทศ) จะยังคงสมบูรณ์หลังการดำเนินการ