note left by a dead person; suicide note; testamentary letter; will
A written message left in anticipation of death or found after death, often a suicide note or final instructions. For a formal legal will, 遺言書 is often the more precise word, but 遺書 can overlap with testamentary writing.
机の上に遺書が残されていた。
A note from the deceased had been left on the desk.
He wrote a suicide note before taking his life.
彼女は家族への遺書に感謝の言葉を書いた。
She wrote words of thanks to her family in her final letter.
posthumous work; writings left behind
Less common, literary or scholarly use for writings or a work left behind by someone after death. In ordinary modern Japanese, 遺著 is often clearer for a posthumous work.
文学の文脈では、遺書が死後に残された著作を指すこともある。
In a literary context, 遺書 can refer to a work left behind after someone's death.
彼女はテーブルの上に遺書を残していた。
She had left a suicide note on the table.
A suicide note was found in the room.
The police discovered a suicide note at the scene.
遺著 specifically means a posthumous literary or scholarly work, a clearer term than the rarer posthumous-work sense of 遺書.
遺言 refers to a person's last wishes, whether spoken or written, whereas 遺書 specifically denotes the written document itself.
expert; connoisseur; person in the know · counter for messages and documents · worldly understanding; tact; insight · supernatural powers; magical powers
A Sino-Japanese compound: 遺 means something left behind or bequeathed, and 書 means writing or document. The spelling is transparently associated with a written thing left after death.