At this point, I won't hesitate to call Claude my favorite AI tool! Yet, I face a serious issue with Claude that occurs during a frequent activity of mine: attaching PDF documents to a prompt.
This issue has been eating up my usage limit faster than I ever imagined, and I've been looking for a solution ever since.
Finally, I found that solution, all thanks to Claude Code.
I added one line to my Claude prompts and stopped getting generic answers
One question from Claude was worth more than ten better prompts from me
The token problem nobody warns you about
Turns out "attach a PDF" has a price tag
Like other AI tools, Claude also lets you attach PDFs and other files to a prompt. I have to do this more often than most people because I deal with research papers, administrative documents, and a few other types of documents. For instance, I may need Claude's help to understand a complex paper or to draft an official document from another PDF. However, there have been multiple instances in which prompts with PDF attachments have exceeded Claude's usage limits without any prior warning.
In many cases, I would upload a multi-page PDF and expect Claude to give me a better response, but I would get a message saying I had reached my usage limit. This behavior becomes even more annoying when you pay for a subscription. After cursing Claude and its usage limits for the longest time, I figured out the problem had more to do with PDF than with Claude. More importantly, I also found a solution: Markdown.
Why Markdown costs a fraction of what a PDF does
Something I wish I'd known earlier
The idea for reducing Claude's usage was simple: use Markdown instead of PDFs. Apparently, there's a lot of hard work Claude has to do when you attach a PDF, but converting it to Markdown solves the problem. This is one of the many special things about Markdown.
This difference arises because PDF documents are not just about text; they also include a lot of other data, such as layout and positioning information, encoding data, image references, and structural overhead, all of which Claude has to handle. Markdown is quite simple, so it weighs only a fraction of what a PDF document does. I have tried this option before, and the results have been impressive. In most cases, Claude used fewer than half as many tokens to process a Markdown file as it did to process a PDF document.
Nevertheless, I did not like having to open another online tool to convert PDFs to Markdown. Fortunately, I figured out I could solve this problem by building a custom tool with Claude. The best part? It took only one single prompt.
One prompt, one working tool
Claude Code does an impressive job
When I came across the idea of creating a web-based tool to convert PDFs to Markdown, I immediately thought of Claude Code. For what it's worth, I have used Claude Code to build web apps that I couldn't find readily available online, and I expected this task to be similar. And Claude Code did not disappoint. I had to open Claude Code on Terminal and enter the following prompt:
Can you build an offline web-based app that can convert a PDF to Markdown? Make sure you air-gap it.
I added the "air-gap" phrase to ensure that Claude downloads and keeps all required files on my machine, rather than expecting the tool to fetch them every time. This way, even if I don't have an internet connection, the PDF-to-Markdown converter will still work. I also didn't want the hassle of running local servers. So, an HTML web-based app was what I had in mind. Surprisingly, Claude Code built the entire thing in less than 3 minutes and opened the HTML file on my web browser.
Something impressive here was that I did not have to have this back-and-forth conversation with Claude Code. Instead, it understood what I wanted from that single prompt and built it for me. Now that I have bookmarked it in my browser, I can access it and convert PDFs to Markdown before I submit anything to Claude. Of course, I do this when I know I am dealing with a large PDF document, so that I cut down token consumption by a long shot.
Living with the PDF to Markdown converter
Using it regularly for a while now
Even though Claude Code built this tool without any further customization options on my end, this PDF-to-Markdown converter works exceptionally well for the core task. As I mentioned earlier, this web page works even without an internet connection and features a very intuitive user interface. I can either use the upload dialog box to select the PDF file or drag and drop the file into the designated area to get started.
Within seconds, this offline web app will process the PDF document and display two sections. On the left, you will see page info, including file size, number of pages, words, and characters. On the right, you can see the Markdown version of the file, with an option to preview it. You can either copy the content from the Markdown or download the .md file. Of course, for this purpose, I need the latter option.
I have tried this tool to convert a wider variety of PDF documents, including scanned documents. If the document is scanned so that the selected text is selectable, it will be converted to a Markdown document, and everything works well. Things are a little different when it is just a scanned document. Overall, whatever Claude Code built is super reliable.
It does not love a scanned PDF
As I said, the only limitation here is that you cannot use this tool to convert scanned-only PDF documents. That seems to be a problem with any PDF-to-Markdown converter in the first place. If you already have a Claude Pro subscription, using this single prompt to build this tool is better than the top ones you would base on Claude, especially if you deal with more PDF documents. By the way, you can use the Artifact builder on Chrome to build a similar option if you want something online.
Claude Code
Claude Code is an agentic coding tool developed by Anthropic that uses multiple AI models from the developer.