Get started

How to add a watermark to a PDF (free, no upload needed)

Add text watermarks to any PDF for free in your browser. Interactive designer, code examples with pdf-lib and Python, plus API automation.

benoitdedMarch 16, 202611 min read

Adding a watermark to a PDF marks the document as confidential, draft, or proprietary. The watermark is a semi-transparent text overlay drawn on every page, visible enough to signal ownership but light enough to keep the content readable.

This guide covers every method: free browser tool, interactive designer, command line, and code (JavaScript + Python), so you can pick what fits your workflow.

What is a PDF watermark?

A PDF watermark is text or an image drawn on top of (or behind) every page of a document. The PDF specification (ISO 32000-1, Section 14.6) defines watermark annotations as a page-level overlay type. Unlike comments or sticky notes, watermarks are part of the page content stream, meaning they appear in print and in every viewer.

Common watermark text:

TextUse case
CONFIDENTIALInternal documents, contracts, financial reports
DRAFTWork-in-progress documents before final approval
SAMPLEDemo copies of paid templates or reports
DO NOT COPYLegal filings, intellectual property
Company nameBrand identification on shared documents

Watermarks serve two purposes: identification (who owns this document) and deterrence (discouraging unauthorized distribution). The global digital watermarking market reached $1.45 billion in 2024 and is projected to hit $3.80 billion by 2033, reflecting how seriously organizations take document provenance.

Watermarks do not prevent access, unlike password protection, which encrypts the file. For the strongest protection, combine both: the password prevents editing (so the watermark cannot be removed), while the watermark identifies the source if the file is shared.

Design your watermark

Before applying a watermark, use the interactive designer below to find the right combination of text, size, opacity, rotation, and position. The preview updates in real time.

Watermark designer
Text
Opacity15%
Rotation-45°
Font size48px
Position
Quarterly report
This document contains proprietary information intended for authorized personnel only. Revenue for Q1 exceeded projections by 12%.
Financial summary
Total revenue: $2.4M. Operating costs remained stable at $1.1M. Net margin improved to 54%, up from 48% in the previous quarter.
Regional breakdown and detailed forecasts are available in the appendix section on page 3.
1/3
// pdf-lib watermark options text: "CONFIDENTIAL" fontSize: 48 opacity: 0.15 rotation: -45

Key parameters to consider:

  • Opacity: 8-15% for subtle branding, 20-40% for strong deterrence. Higher opacity makes text harder to read.
  • Rotation: -45° (diagonal) is the most common angle. It crosses the page corner-to-corner, making it difficult to crop out.
  • Font size: 48-72px for A4/letter pages. Scale down for smaller formats.
  • Position: center is standard. Bottom-right works for subtle brand stamps.

The fastest way to watermark a PDF is PDF4.dev's free browser tool. No software, no account, no file upload to any server.

  1. Go to Watermark PDF
  2. Upload your file (drag and drop or click to browse)
  3. Enter your watermark text
  4. Adjust opacity and font size
  5. Click Add Watermark and download

Why it works well:

  • The watermark is permanently drawn on every page, not just a viewer overlay
  • Files are processed by pdf-lib in your browser, they never reach a server
  • No file size limits, no watermarks-on-your-watermark, no account required

Watermark placement patterns

The placement pattern determines how well the watermark resists removal. A single centered watermark can be cropped out by trimming the page. A repeated pattern covers the entire page surface, making removal impractical without damaging the content.

Watermark patterns
Pattern

One centered watermark. Best for internal drafts.

Quarterly report
This document contains proprietary information intended for authorized personnel only. Revenue for Q1 exceeded projections by 12%.
Financial summary
Total revenue: $2.4M. Operating costs remained stable at $1.1M. Net margin improved to 54%, up from 48% in the previous quarter.
Regional breakdown and detailed forecasts are available in the appendix section on page 3.
1/3
// Pattern configuration pattern: "single" coverage: "center" // 1 watermark per page
PatternWatermarks per pageRemoval difficultyBest for
Single center1Easy to cropInternal drafts, light branding
Diagonal repeated6-10ModerateShared documents, review copies
Grid12-20Very difficultSensitive financials, legal documents

For maximum protection, combine a grid watermark with password protection. The password prevents editing (so the watermark cannot be removed), while the watermark identifies the document if the password is shared.

Before and after

Drag the slider to compare a document with and without a watermark. Notice how the text remains fully readable at 12% opacity.

Before / after
Non-disclosure agreement
This agreement is entered into by and between the parties identified below. All confidential information shared during the term of this agreement shall remain proprietary.
Section 2: Obligations
The receiving party agrees to hold and maintain all confidential information in strict confidence. Unauthorized disclosure may result in legal action.
Both parties acknowledge and agree to the terms set forth in this document as of the effective date below.
1/1
Non-disclosure agreement
This agreement is entered into by and between the parties identified below. All confidential information shared during the term of this agreement shall remain proprietary.
Section 2: Obligations
The receiving party agrees to hold and maintain all confidential information in strict confidence. Unauthorized disclosure may result in legal action.
Both parties acknowledge and agree to the terms set forth in this document as of the effective date below.
1/1
OriginalWatermarked

At low opacity, the watermark is barely noticeable during normal reading but immediately visible when someone tries to pass the document off as their own. This is the key tradeoff: visibility for deterrence versus readability for the intended audience.

Method 2: Command line with qpdf and Ghostscript

For batch processing or scripting, command-line tools offer more control.

Using Ghostscript

Ghostscript can stamp a watermark from a separate PDF onto every page:

# Create a watermark PDF first (single page with your text)
gs -dBATCH -dNOPAUSE -sDEVICE=pdfwrite \
   -sOutputFile=watermarked.pdf \
   -c "<</PageSize [595 842]>> setpagedevice \
       0.85 setgray /Helvetica-Bold 60 selectfont \
       100 400 moveto 45 rotate (CONFIDENTIAL) show" \
   -f input.pdf

Using cpdf

cpdf provides a cleaner command for text stamping:

cpdf -stamp-on watermark.pdf input.pdf -o output.pdf

For more control, qpdf's overlay feature can stamp a pre-built watermark PDF onto every page of another document.

Limitations: command-line tools require installation, offer limited font options, and have no preview. They work best for CI/CD pipelines or server-side batch jobs.

Method 3: JavaScript with pdf-lib

pdf-lib is the most popular JavaScript library for PDF manipulation. It runs in Node.js and the browser, has zero dependencies, and handles watermarking in under 20 lines of code. The key method is page.drawText(), which accepts position, font, size, color, rotation, and opacity parameters.

import { PDFDocument, StandardFonts, degrees, rgb } from "pdf-lib";
import { readFileSync, writeFileSync } from "fs";
 
async function addWatermark(inputPath: string, outputPath: string) {
  const doc = await PDFDocument.load(readFileSync(inputPath));
  const font = await doc.embedFont(StandardFonts.HelveticaBold);
 
  for (const page of doc.getPages()) {
    const { width, height } = page.getSize();
    const text = "CONFIDENTIAL";
    const fontSize = 60;
    const textWidth = font.widthOfTextAtSize(text, fontSize);
    const rad = (-45 * Math.PI) / 180;
 
    page.drawText(text, {
      x: width / 2 - (textWidth / 2) * Math.cos(Math.abs(rad)),
      y: height / 2 + (textWidth / 2) * Math.sin(Math.abs(rad)),
      size: fontSize,
      font,
      color: rgb(0.5, 0.5, 0.5),
      opacity: 0.15,
      rotate: degrees(-45),
    });
  }
 
  writeFileSync(outputPath, await doc.save());
}
 
addWatermark("input.pdf", "watermarked.pdf");

Custom fonts

The standard fonts (HelveticaBold, TimesRoman, Courier) are always available. For custom fonts, embed them from a file:

const fontBytes = readFileSync("fonts/Inter-Bold.ttf");
const customFont = await doc.embedFont(fontBytes);

pdf-lib supports .ttf and .otf fonts. Google Fonts files work after downloading the font file.

Repeated pattern watermark

To create a grid pattern that covers the entire page, loop over a grid of coordinates:

const text = "CONFIDENTIAL";
const fontSize = 24;
const spacing = 200; // pixels between each watermark
 
for (const page of doc.getPages()) {
  const { width, height } = page.getSize();
  for (let y = 0; y < height; y += spacing) {
    for (let x = 0; x < width; x += spacing) {
      page.drawText(text, {
        x,
        y,
        size: fontSize,
        font,
        color: rgb(0.5, 0.5, 0.5),
        opacity: 0.06,
        rotate: degrees(-30),
      });
    }
  }
}

Method 4: Python with pypdf

pypdf is the standard Python library for PDF manipulation. Watermarking requires two steps: generate a single-page watermark PDF with ReportLab (for the text rendering), then merge it onto every page of the target document using pypdf's merge_page() method.

from pypdf import PdfReader, PdfWriter
from reportlab.pdfgen import canvas
from reportlab.lib.pagesizes import A4
from io import BytesIO
 
def create_watermark(text: str = "CONFIDENTIAL") -> bytes:
    """Generate a single-page PDF with a diagonal watermark."""
    buffer = BytesIO()
    c = canvas.Canvas(buffer, pagesize=A4)
    width, height = A4
 
    c.saveState()
    c.translate(width / 2, height / 2)
    c.rotate(45)
    c.setFont("Helvetica-Bold", 60)
    c.setFillAlpha(0.15)
    c.setFillColorRGB(0.5, 0.5, 0.5)
    c.drawCentredString(0, 0, text)
    c.restoreState()
    c.save()
 
    buffer.seek(0)
    return buffer.read()
 
 
def watermark_pdf(input_path: str, output_path: str):
    watermark_bytes = create_watermark()
    watermark_page = PdfReader(BytesIO(watermark_bytes)).pages[0]
 
    reader = PdfReader(input_path)
    writer = PdfWriter()
 
    for page in reader.pages:
        page.merge_page(watermark_page)
        writer.add_page(page)
 
    with open(output_path, "wb") as f:
        writer.write(f)
 
 
watermark_pdf("input.pdf", "watermarked.pdf")

Method 5: PDF4.dev API (automated)

For production workflows where PDFs are generated from templates, add watermarks directly in the HTML template using CSS. This avoids a separate watermarking step entirely.

curl -X POST https://pdf4.dev/api/v1/render \
  -H "Authorization: Bearer p4_live_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "template_id": "contract",
    "data": {
      "client_name": "Acme Corp",
      "watermark_text": "DRAFT"
    }
  }'

CSS watermark in your HTML template

Add a watermark layer directly in your Handlebars template using CSS positioning:

<div class="watermark">{{watermark_text}}</div>
 
<style>
  .watermark {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-45deg);
    font-size: 60px;
    font-weight: bold;
    color: rgba(0, 0, 0, 0.08);
    pointer-events: none;
    white-space: nowrap;
    z-index: 1000;
  }
</style>

With this approach, the watermark text is a template variable. Pass "DRAFT" during review and remove it (or pass an empty string) for the final version, all from the same template.

Watermark vs password protection

Watermarks and password protection solve different problems. Here is when to use each:

FeatureWatermarkPassword protection
Prevents openingNoYes (open password)
Prevents editingNoYes (permissions password)
Visible in documentYesNo
Identifies sourceYesNo
Deters sharingModerateStrong
Removable by recipientYes, with toolsNo, without password
Impact on readabilitySlight (at low opacity)None

Use watermarks when you want the document to be freely readable but traceable: review copies, shared proposals, sample documents.

Use password protection when you want to restrict who can open or edit the file: contracts, financial data, legal filings.

Use both together when the document is sensitive and must be both traceable and access-controlled: confidential financial reports, pre-release legal documents.

Learn more about encryption in the password protection guide.

When to watermark (and when not to)

Good use cases

  • Review copies: mark documents as DRAFT until final approval, so recipients know the content may change
  • Shared proposals: add your company name to proposals sent to prospects, establishing ownership
  • Sample documents: let potential customers preview paid templates with a SAMPLE watermark
  • Internal distribution: mark sensitive documents as CONFIDENTIAL to signal handling requirements
  • Legal discovery: courts accept watermarked documents as evidence of original authorship when combined with metadata timestamps

In the United States, watermarks qualify as "copyright management information" under 17 U.S.C. Section 1202. Intentionally removing a watermark from a copyrighted document carries civil penalties of $2,500 to $25,000 per violation. Criminal penalties can reach 5 years imprisonment and a $500,000 fine for a first offense.

This makes watermarking more than a visual deterrent: it creates a legal record of ownership that courts recognize.

When watermarks are not enough

  • Preventing screenshots: watermarks do not prevent screen captures. If the content is visible, it can be captured.
  • Strong access control: use password protection instead. Watermarks do not restrict access.
  • Tamper-proofing: digital signatures (not covered here) provide cryptographic proof that a document has not been modified.

Quick reference

MethodBest forOpacityRepeated patternBatch support
Browser toolQuick one-off filesPreset (3 levels)NoNo
pdf-lib (JS)App integration, automationFully customYesYes
pypdf (Python)Scripts, data pipelinesFully customYesYes
Ghostscript (CLI)Server-side, CI/CDLimitedManualYes
PDF4.dev APIProduction templatesVia CSSVia CSSYes

For most users, the free browser tool handles the job in under 30 seconds. For developers building watermarking into an application, pdf-lib (JavaScript) or pypdf (Python) provide full control over every parameter. For production template workflows where PDFs are generated from HTML, the CSS approach via the PDF4.dev API is the cleanest solution.

Need to watermark PDFs at scale? PDF4.dev lets you generate watermarked documents directly from HTML templates via a single API call. The watermark text, opacity, and position are all controlled through CSS and Handlebars variables. Get started free.

Free tools mentioned:

Watermark PdfTry it freeProtect PdfTry it freeCompress PdfTry it free

Start generating PDFs

Build PDF templates with a visual editor. Render them via API from any language in ~300ms.