本文へスキップ

PDFをテキストに変換

文字を取り出して、プレーンな.txtにします。

お使いの端末で処理

このツールはブラウザーの中だけで動きます。ファイルがアップロードされることはなく、そのことはブラウザーのネットワークタブでご自身で確認できます。 ご自分で確かめてください。ブラウザーのネットワークタブを開いて見てください。残りの作業回数を尋ねる小さなリクエストが1つだけ表示されます。ツール名とハッシュだけで、ファイルは決して含まれません。

このツールでできること

This extracts the words from a PDF and writes them into a plain .txt file. A PDF does not store text as sentences - it stores glyphs at coordinates - so reading order, word boundaries and paragraph breaks are all reconstructed from the geometry of the page. Every extractor guesses that slightly differently, which is why the same document gives different output in different tools, and why there are two modes here rather than one.

Lifting a quotation out of a report without retyping it, feeding a document to a script or a language model, searching a book you only have as a PDF, or checking what a page actually contains when a table detector insists it found nothing.

仕組み

  1. Drop the PDF onto this page. One file at a time, up to 300 MB.
  2. Choose reading order for prose you intend to paste somewhere, or layout to keep columns and tables lined up with spaces.
  3. Decide whether pages are separated by a marker line and whether page numbers are printed into the file.
  4. Leave rejoin hyphenated words on so a word broken across a line break comes back together.
  5. Under advanced options, set a page range, or switch the encoding to UTF-8 with a BOM if Excel or Notepad will open the file.
  6. Press Convert to text and the .txt downloads on its own.

The two modes solve opposite problems. Reading order joins the lines of a paragraph back into flowing prose, which is what you want in an email, a script or a quotation. Layout mode keeps every line where it was on the page, padding with spaces so columns stay aligned - right for a table, a code listing or a form, and wrong for prose, where the padding becomes ragged whitespace you then strip out. If the output looks strange, the mode is usually why.

Rejoining hyphenated words is more careful than a search-and-replace. A hyphen at the end of a line is joined only when the character before it and the first character of the next line are both lowercase, so a word broken as inter- and national comes back as international, while a compound such as self-service, or a hyphen followed by a capitalised name, is left as written. The rule errs towards leaving a real hyphen alone rather than towards editing your text.

A scanned document is detected before any work happens. The first five pages are sampled for a text layer, and when there is none the tool stops and points at OCR, since a scan is a picture of words with nothing in it to extract. Reporting no text found would be technically true and practically useless.

The encoding option is small and saves a familiar afternoon. UTF-8 without a byte order mark is what a script, a git repository or a text editor wants. UTF-8 with a BOM is what makes Excel and Notepad recognise the file as UTF-8 instead of guessing a legacy code page and mangling every accented character. If names come out as strings of symbols, the BOM is what was missing.

Extraction runs in a Web Worker and the text file is written there too, so a confidential document is never sent anywhere to have its words read. The result reports the page count, the character and word counts and how many pages came out empty - often the quickest sign that part of a document is scanned while the rest is not.

このツールにできないこと

  • Columns, sidebars, headers and footnotes come out in the order the reconstruction decides on, which is not always the order a person reads them in. Layout mode is often clearer for those pages.
  • A scanned page contains no text to extract. That is detected and reported with a link to OCR rather than writing an empty file.

よくある質問

「読む順番」と「ページのレイアウトを保つ」の違いは何ですか?
「読む順番」は段落を組み直し、それぞれの行をつないで、どこにでも貼れる流れる文章にします。「ページのレイアウトを保つ」は空白で間を埋めてページの形を保つので、等幅で見たときに列・表・コードの並びがそろいます。文章には「読む順番」を、文字の横位置に意味があるときは「ページのレイアウトを保つ」を使ってください。
PDFから何も出てきませんでした。なぜですか?
ほぼ間違いなく、それがスキャンだからです。スキャンされたページが持っているのは文字の写真であって文字ではないため、取り出せるテキストのレイヤーがありません。作業を始める前に先頭5ページを調べ、なければ止めて「OCR」へご案内します。「OCR」は写真を本物の文字に変えるので、そのあとで取り出せます。
文字がばらばらの順番で出てきました。直せますか?
まず「ページのレイアウトを保つ」を試してください。順番が乱れるのは、たいてい段組みのページで、列をまたいで行がつながれた場合です。この設定は各列をあった場所に残すので、読みやすく、あとで整えるのも楽になります。ヘッダー・フッター・傍注を、読む順番とは無関係な順序で置いているドキュメントもあり、それをどの抽出ツールも確実に見抜くことはできません。
ファイルを開くと、アクセント付きの文字が変です。どうすればいいですか?
文字コードを「UTF-8(BOM付き)」に変えて、もう一度変換してください。バイトオーダーマークは、Excelやメモ帳に、このファイルはUTF-8だと伝えます。それがないと古い文字コードだと推測され、アクセント付きの1文字が2つの記号に化けます。スクリプト・エディター・バージョン管理に渡すなら、BOMなしのUTF-8のままにしてください。
文字を取り出すためにドキュメントはアップロードされますか?
されません。PDFの解析もテキストファイルの書き出しもブラウザーの中で行われ、どの時点でも何も送信されません。契約書やカルテのようなドキュメントでは、これは知っておく価値があります。変換中に開発者ツールのネットワークタブを見ていれば確かめられますし、オフラインでも動きます。

関連ツール