HTML to PDF API — Fast, Affordable & Secure

Transform webpages and HTML code into high-quality PDF documents in seconds. Our HTML to PDF API is completely secure, requires no installation, and is quick to integrate.

From HTML to PDF in Three Steps

Use the converter above in your browser, or call the same service from your own code.

  1. Provide your input

    Paste HTML, upload a single .html file (up to 5 MB), or enter the address of a public web page.

  2. CheapPDF renders it

    The page is rendered in a headless browser using the page size you choose, in pixels. Landscape and background printing are optional.

  3. Download or integrate

    Download the PDF from the converter, or call the API and decode the base64 PDF from the JSON response in your application.

Integrate PDF Generation into Your Stack

Send HTML, a public URL or an .html file in one POST request and receive the PDF as base64 in a JSON response. Pick your language, copy the example and add your own API key.

Store the key in an environment variable on your server. Do not put it in browser-side code.

Language guides: PHP, Laravel, Node.js, Python

Free plan: 10 conversions per day, no credit card.

curl -X POST https://www.cheap-pdf.com/generate-pdf-public \
  -F "apikey=YOUR_API_KEY" \
  -F "filename=hello.pdf" \
  -F "width=800" \
  -F "height=1000" \
  --form-string "fileorhtmlorurl=<h1>Hello from CheapPDF</h1>" \
  -o response.json

# The PDF is returned base64-encoded inside the JSON:
jq -r '.data.base64_pdf' response.json | base64 --decode > hello.pdf

Response codes & samples

200

OK

The PDF was generated and is returned as a base64 string.

response-200.json JSON
{
  "success": true,
  "data": {
    "status": "success",
    "code": 200,
    "message": "PDF generated successfully",
    "base64_pdf": "JVBERi0xLjQK...",
    "filename": "hello.pdf"
  }
}
400

Invalid API key

The apikey field is missing or not recognised. Check it against your dashboard.

error-invalid-key.json JSON
{
  "success": false,
  "message": "Invalid API key, please get a new API key from the dashboard",
  "error": "invalid_api_key"
}
400

Daily limit reached

The free plan allowance for today is used up. Try again tomorrow or upgrade.

error-limit.json JSON
{
  "success": false,
  "message": "Free plan limit reached (10 conversions per day). Please try again tomorrow or upgrade to continue converting.",
  "error": "free_plan_limit_reached",
  "limit": 10
}

See What You Can Create with CheapPDF

Six sample documents built with plain HTML and CSS. Each preview below is the HTML rendered in your browser. Load one into the converter and press Convert to PDF to get the real PDF. All data is invented.

Built for Real-World HTML Documents

CheapPDF renders your page in a headless browser, so the CSS in your HTML is applied the way a browser applies it. The table lists what we can state with confidence from how the service works.

Practical tips

  • Inline your CSS in a <style> tag, or link stylesheets that are public.
  • Use absolute public image URLs, or embed small images as data: URIs.
  • Set the page width in pixels to match your layout, then test the result.
  • For pages behind a login, render the HTML on your server and send that HTML instead.

Troubleshooting guide API reference

What is supported
Capability Status
Raw HTML input Supported
Public URL input (http/https) Supported
Uploaded .html file Up to 5 MB
Page width and height (px) Supported
Landscape orientation API option
Background colors and images On by default
Localhost and private networks Blocked
Pages behind a login Not supported
Page breaks, headers, footers, web fonts, JavaScript Not documented: test your template

We do not claim that every HTML or CSS feature renders identically to your desktop browser.

Why developers and businesses choose the CheapPDF HTML to PDF API

Fast
Reliable
Secure
User Friendly

Understand How Your Documents Are Handled

Here is what we can state about how requests are handled. For the full terms, read the page linked below.

Terms and privacy

CheapPDF Customer Testimonials - What Users Say

"CheapPDF transformed our invoicing process. We save hours every week and our clients appreciate the professional PDFs we can now generate instantly."

Cameron Williamson

Operations Manager, BiggDroid

★★★★★

HTML to PDF API Pricing – Free & Premium Plans

Start free with our HTML to PDF API. Upgrade for unlimited daily conversions for $5/month.

$0 forever

Free Plan

  • Basic conversion features
  • 10 conversions per day
  • Free API key included
  • Perfect for starters
Get Started
$5 per month

Premium Plan

  • Unlimited conversions per day
  • HTML file uploads up to 5 MB
  • Same API, no daily cap
  • Usage and payment history in your dashboard
Upgrade to Premium Cancel anytime

Estimate your PDF generation cost

Assumes usage is spread evenly over a 30-day month. The free plan limit applies per day, so a busy day above 10 conversions needs Premium.

Start Building with CheapPDF

Guides for the languages and documents developers ask about most.

FAQ: HTML to PDF API & Conversion Questions

Get answers to common questions about CheapPDF's HTML to PDF API, conversion features, security, pricing, and integration. Learn how to use our API to convert webpages and HTML code to PDF quickly and securely.

What formats do you support for PDF conversion?

We support conversion from any public URL (webpages), raw HTML files (.html/.htm), and pasted HTML code. The output is always a high-quality PDF file, available for immediate download. Our converter handles complex layouts, images, CSS, and responsive designs.

Is my data secure and private on CheapPDF?

Requests are sent over HTTPS, and the API checks your API key on every request. The generated PDF is returned in the response, and the request log records metadata such as time, IP address and request path rather than document content. See the Terms and privacy page for details.

Is CheapPDF really free? Are there any hidden costs?

The web converter can be used without an account. The free plan allows 10 conversions per day, including a free API key. Premium costs $5/month and removes the daily limit. You can cancel anytime.

Do I need to install software or create an account to use CheapPDF?

No installation or account creation required! CheapPDF is 100% web-based. Simply visit our site, paste a URL, upload an HTML file, or paste HTML code, and download your PDF instantly. No downloads, no setup, no hassle.

What are the file size limits for PDF conversion?

HTML file uploads can be up to 5 MB. Web pages are fetched from their public URL. The upload limit is the same on the free and Premium plans.

Can I use CheapPDF's API to integrate PDF conversion into my application?

Yes. CheapPDF provides a REST API: send a POST request with your API key and HTML, a URL or an .html file, and the PDF comes back as base64 in the JSON response. Free accounts get an API key too. See the guides for PHP, Laravel, Node.js and Python.

How long does it take to convert a webpage to PDF?

Conversions are synchronous: the PDF is returned in the same response. Time depends on the size and complexity of the page and any external images or styles it loads. Set a client timeout of about 60 seconds.

Can I adjust the PDF output size and dimensions?

Absolutely! You can customize the width and height (in pixels) for your PDF output. This gives you control over how your webpage is rendered. Common presets are included for convenience, or you can enter custom dimensions.

What browser and devices does CheapPDF work on?

CheapPDF works on all modern browsers (Chrome, Firefox, Safari, Edge) and all devices (desktop, tablet, mobile). Since it's web-based, no special software or plugins are needed. Just open our website and start converting.

How can I get help or report issues with CheapPDF?

Our support team is happy to help! You can contact us through the contact form on our website or email contact@cheap-pdf.com. We typically respond within 24 hours. Check our help documentation for common questions and troubleshooting tips.

What is an HTML to PDF API?

An HTML to PDF API allows developers to programmatically convert HTML content, such as webpages or HTML files, into PDF documents. CheapPDF provides a powerful REST API for this purpose, enabling seamless integration into your applications.

Generate your first PDF in minutes

Try the converter above, or create a free API key and send your first request.

Subscribe to Our Newsletter for Fast HTML to PDF Updates

Stay updated on new features for our fast, simple, and affordable HTML to PDF API.