Rename a PDF From Its Text
Auto Rename returns your PDF unchanged. On the website the download keeps its original name; through the API, useFirstTextAsFallback=true names it after the first word of its text, up to 60 characters.
Drag and drop files here, or click to choose
Accepts PDF · up to 500.0 MB per file · up to 20 files at once
You can also paste a file with Ctrl/Cmd+V, or from the clipboard menu.
Auto Rename returns the original PDF bytes. The download name stays the source base name unless `useFirstTextAsFallback=true`, in which case the first whitespace-delimited token of extracted text (sanitized, max 60 characters) becomes the name.
The website has no such checkbox, so the portal path is a pass-through with the original filename. It is not OCR and not an AI title generator.
Password-protected files are unlocked for you on this page once you enter the password; API callers run Unlock first if load fails.
If you need a title in the Info dictionary, use Update Metadata.
What the rename rule really is: with the flag set, the tool extracts text from all pages, splits it on whitespace and keeps only the first word. That word is sanitized by trimming any leading and trailing characters that are not letters or digits, then cutting it to 60 characters. If nothing is left, for example because the PDF has no text layer or its first token was only punctuation, the original base name is used instead. The result is that `Invoice 2024-001 ...` is named `Invoice.pdf`, not `Invoice 2024-001.pdf`, so many different documents that begin with the same word get the same name.
Because only the first word is used, this tool suits narrow automation, such as a pipeline where every file starts with a unique code or reference number, and does not suit people hoping for descriptive names like a vendor and date. The tool does not read the document title, headings, metadata or dates, and it never changes the bytes of the file: only the suggested download name differs.
Decision guide: to rename by hand, rename the file on your device; to set a visible title inside the PDF, use Update Metadata; to name pieces from bookmarks, use Split by Chapters; to get a text layer so the first word exists on a scan, run OCR PDF with the Searchable PDF output first, then call this tool through the API with the flag.
Features
- Default: original bytes and original base name
- `useFirstTextAsFallback` is API-only on this site
- Not OCR smart naming
- Anonymous API at /api/v1/misc/auto-rename
- Name is trimmed of surrounding punctuation and capped at 60 characters
- Falls back to the original base name when no usable text exists
When to use this tool
- API-rename from the first text token when you set the flag
- On the website, treat this as a no-op download of the same PDF
- Prefer Update Metadata for a visible title
- Name machine-generated reports whose first word is a unique reference code in an automated pipeline
- Confirm that a file survives upload and download byte for byte before you build a workflow around it
How does Auto Rename name a PDF?
- Decide whether you need the website or the API. The website always returns the same name, so a rename needs the API.
- For the website, upload the PDF and click Process; expect the identical file with its original base name.
- For the API, send the file with `useFirstTextAsFallback=true` to `/api/v1/misc/auto-rename` and read the filename from the `Content-Disposition` response header.
- If the header still shows the original name, the PDF probably has no extractable text; run OCR PDF with the Searchable PDF output on it and call again.
- Save the response under the name from the header and compare checksums with the original if you want proof that the bytes are unchanged.
Limits and edge cases
- Portal has no rename flag
- Not OCR
- Bytes unchanged
- Only the first word of text is used
- Names are capped at 60 characters
- Text must already exist in the PDF
- Upload limit on this website: 500 MB per file, sent in chunks above about 95 MB. A single direct API request body is capped at 100 MB.
Examples
- Website upload of report.pdf downloads as report.pdf with identical bytes
- API flag true on a PDF whose text begins `Hello world` returns `Hello.pdf`
- API flag true on a PDF whose text begins `(Confidential) Quarterly results` returns `Confidential.pdf`
- API flag true on a scanned PDF with no text layer returns the original base name, because the first token is empty
- A text PDF named `scan0042.pdf` that starts `INV-88213 Payment due` is returned as `INV-88213.pdf`, which is a useful result when the code is unique
Privacy for this tool
Files are uploaded over HTTPS, processed in memory or a short-lived temporary directory on our servers, and deleted when your result is ready. We do not keep copies for later browsing, training, or advertising profiles. See the Privacy Policy for retention details and AdSense cookie disclosures.
Frequently asked questions
- Why didn't the filename change?
- The website does not send useFirstTextAsFallback. The op then keeps the original base name.
- Does it read the title metadata?
- No. The optional rename path uses the first extracted text token, not Info.Title.
- Will a scan get a name from the heading in the photo?
- No. This tool does no OCR, so empty text keeps the original name even with the flag. Run OCR PDF with the Searchable PDF output first if you want the first recognized word used.
- Are the PDF bytes rewritten?
- No. The original bytes are returned.
- Why did my name come out as one word?
- Only the first whitespace-delimited token is used. A document starting with `Annual Report 2024` is named `Annual.pdf`. If you need more than one word, rename it yourself or build the name from the extracted text in your own script.
- What happens to punctuation in the first word?
- Characters that are not letters or digits are trimmed from both ends, so `(Confidential)` becomes `Confidential`. Names longer than 60 characters are cut at 60.
- Do two files with the same first word collide?
- Each response only carries a suggested name, so nothing is overwritten on our side, but if you save both into one folder with the same name your system will overwrite or add a suffix. Check names before bulk saving.
- Is it safe to use on sensitive PDFs?
- The file is processed in memory or a temporary directory and deleted when the result is ready. The bytes returned are identical to what you sent.
Last updated:
Call this from code
Every tool on this site is a plain REST endpoint - no account or API key needed for anonymous use. Built for AI agents and developers as much as for browsers.
curl -X POST "https://pdf123.xyz/api/v1/misc/auto-rename" \
-F "[email protected]" \
-o output.pdfAlso available as an MCP tool for agent clients that speak Model Context Protocol (JSON-RPC 2.0 over POST /mcp). Full API reference
Use it from an AI agent
SkillClaude Code, Codex, Cursor and other AI agents can run Auto Rename for you with this skill: /skills/pdf123-auto-rename.md
Files are used only for this processing job and deleted automatically afterward.