file in abyss
フォーマット一覧へ戻る

Document

MD Markdown

READMEや技術文書で広く使われる軽量マークアップ。固定のバイナリシグネチャはありません。

Extensions .md, .markdown
MIME text/markdown

マジックナンバー

ファイルを解析
オフセット 0 見出しで始まるMarkdownサンプル
23 20
#

構造

  1. Plain text
  2. Headings
  3. Paragraphs
  4. Lists
  5. Links

注意点

  • Markdown一般には固定マジックナンバーがなく、通常は拡張子や内容の文脈で判定します。

判定コード例

SIGNATURE = bytes.fromhex("2320")
OFFSET = 0

def is_md(path: str) -> bool:
    with open(path, "rb") as f:
        f.seek(OFFSET)
        head = f.read(len(SIGNATURE))
    return head == SIGNATURE

実践的な使い方

ユースケース

Markdown はデータ交換、インポート/エクスポート、パーサのテスト、検証ワークフローで使われます。エンコーディング・区切り文字・バージョン・コンテナ構造が実装の挙動を変えることがあります。

よくある判定ミス

  • .md / .markdown という拡張子だけではファイルの中身を保証できません。アップロードや変換の処理では、拡張子・MIMEタイプ・先頭バイト・形式固有の構造チェックを組み合わせるべきです。
  • Markdown は 23 20 のようなシグネチャで始まりますが、関連するコンテナや破損ファイルでは追加の検証が必要になる場合があります。

セキュリティ上の注意

文書形式はスクリプト・添付・マクロ・外部参照を含むことがあります。プレビューや変換はサンドボックス化し、信頼できないファイルを直接開かないでください。

サンプルの活用

11 個のサンプルで、先頭バイト判定・パーサのエラー・アップロード上限・ダウンロード挙動をテストできます。

サンプルファイル

11 / 11 files
Sample Traits Size Source / license / SHA-256
Doc

Blue Sky MD

Blue Sky MD is a Markdown sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

01-blue-sky.md
Type Sample
Small file
135 B
SHA-256 e601110dd647a3e36a5066a3134ae6203cf137dafc0930c171d3becd6c2b08d0
Download
Doc

Flower Garden MD

Flower Garden MD is a Markdown sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

02-flower-garden.md
Type Sample
Small file
199 B
SHA-256 958f31e5bc3971ec7e64fcc6d462cddeb33b65a7d2e05c3936403964107ad21d
Download
Doc

Navy Blue Sky MD

Navy Blue Sky MD is a Markdown sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

03-navy-blue-sky.md
Type Sample
Small file
194 B
SHA-256 557cca18ab0d22632b3864bf6ed6c4bb6240bc27e04d8b16e8e94b6ef62f0413
Download
Doc

Nature of the Sky MD

Nature of the Sky MD is a Markdown sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

04-nature-sky.md
Type Sample
Small file
195 B
SHA-256 7c772e89e19c32f13646aeb63be3f340758fc2b87b53d0c24bd53e0d09c229d3
Download
Doc

Sky Landscape MD

Sky Landscape MD is a Markdown sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

05-sky-landscape.md
Type Sample
Small file
290 B
SHA-256 40c0f744371b70943b0dbad46bdf09a73daf9c298fc36b9fffad687a401c3c4c
Download
Doc

Starry Sky MD

Starry Sky MD is a Markdown sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

06-starry-sky.md
Type Sample
Small file
195 B
SHA-256 edb76a5c7e82de5990d771696c4e4a49d72cfba7b348e46793edb1ea96d5ae21
Download
Doc

Blue Night Sky MD

Blue Night Sky MD is a Markdown sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

07-blue-night-sky.md
Type Sample
Small file
243 B
SHA-256 84a83bff6547257be087824787d0108814161232f3ad0745fd723433cf56fd0c
Download
Doc

Hibiscus Flower MD

Hibiscus Flower MD is a Markdown sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

08-hibiscus-flower.md
Type Sample
Small file
384 B
SHA-256 3edfe6b56fde0f49b507896a893cfdb6af542339336e173f1c1f08f6f1560861
Download
Doc

Arctic Sky MD

Arctic Sky MD is a Markdown sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

09-arctic-sky.md
Type Sample
Small file
314 B
SHA-256 14000757d95cb6147b1977862f2002872ed6902ff9c9a3b2d330a30a28d1460b
Download
Doc

Sunset Rays MD

Sunset Rays MD is a Markdown sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

10-sunset-rays.md
Type Sample
Small file
338 B
SHA-256 631007f568fea9750956728b96f424cbd5a136f8e89677b7c0344e184b0edbcb
Download
Doc

NASA Blue Marble MD

NASA Blue Marble MD is a Markdown sample based on NASA Image and Video Library. It can be used to test downloads, parsers, previews, and file type detection.

nasa-blue-marble-2012-east.md
Type Sample
Small file
664 B
SHA-256 6fc911149dd9d9ef1df0cfbe645a0e8b82b60cb73a1b580ff894a26d8d2f4da7
Download

よくある質問

Markdown のマジックナンバー(ファイルシグネチャ)は?

Markdown ファイルはバイトシグネチャ 23 20 ("# ") で始まります。拡張子に頼らず、この先頭バイトを読み取って形式を判定してください。

Markdown のMIMEタイプは?

Markdown のMIMEタイプは text/markdown です。

Markdown の拡張子は?

Markdown ファイルは .md, .markdown 拡張子を使います。拡張子は慣習にすぎず中身を保証しないため、シグネチャや構造のチェックと組み合わせてください。

関連フォーマット