BLACK FRIDAY SALE 50% OFF +1 FREE MONTH LIMITED TIME DEAL Grab The Deal
50% OFF +1 FREE MONTH Grab The Deal

HTML PayPal Button code

Add a PayPal payment button to your HTML page for purchases, subscriptions and donations – build it in the editor, copy the code and paste it in.
4.8 rating
10,000+ reviews
Free plan available
Create Widget for Free
No credit card needed
HTML PayPal Button code

Create your PayPal Button widget

Configure your PayPal Button and add it to your HTML website for free!

Screenshots

HTML PayPal Button code
Provide easy paying on your website with Checkout button
Set Subscription button to allow quick subscribing for your services
Let users decide how much they want to share, with Donate button.
Vary the size, choose elements, pick colors and more personalization options.
Clean design fits into almost every website without much customization.
Looks and works perfectly on any device, from desktop to mobile
1 / 6

Why add PayPal payments to your HTML website

One widget covers one-time payments, subscriptions and donations, so you do not need a separate tool for each. Set up the button in the editor and choose the payment type that fits your offer.

Tax and shipping are calculated automatically and included in the final PayPal amount, so buyers see the full total. Pick the currency and set the localization for your audience’s country.

Key features of the HTML PayPal Button

  • One-time payments, subscriptions and donations – choose the payment type in the editor.
  • Tax and shipping – set shipping as a fixed amount and tax as either a fixed amount or a percentage; both are included in the final amount.
  • Currency and localization – select a global currency and set the button localization from a list of countries.
  • Button design – set the width, height, shape, border radius and colors.
  • Card icons – show or hide payment method icons such as Visa, Mastercard and American Express.
  • Thank-you page – redirect buyers to a custom page after a transaction.
  • Responsive size – the button looks right on any device.

More options in the live editor.

Add a donation button to your HTML website

Collect donations with the same button you use for sales.

  • Pick donations as the payment type in the editor, next to one-time payments and subscriptions.
  • Let donors enter their own contribution amount.
  • Choose the currency your donors use, then copy the code and paste it into your page.

How to add PayPal Button to an HTML website

Create your button in the Elfsight editor and configure its payment settings. In your Elfsight dashboard, find the widget and click Install → Copy Code.

Good to know: Your website must allow HTML embeds and JavaScript. Insert the complete installation code inside <body>, where the button should appear.

Method 1: Add the button to a single page

  1. Open your website files in a code editor or hosting file manager.
  2. Select the HTML file for the page you want to edit.
  3. Paste the installation code where the button should appear, such as beside a product description or below a service price.
  4. Save the file. If you edited it locally, upload the updated version to your server.
  5. Open the published page and check the button’s appearance and payment destination.

Method 2: Add the button through a shared template

Use this method if your website includes a shared template or component across multiple pages.

  1. Open the shared template or included file, such as your footer or sidebar.
  2. Paste the installation code where you want the button within that layout.
  3. Save your changes and publish or rebuild your website as required.
  4. Check several pages that use the template to confirm the button appears correctly.

Note: The shared file must actually be included by your website. Creating a file named footer.html alone won’t display the button on every page.

Method 3: Add the button to multiple separate HTML pages

If your website has no shared templates, update each page individually.

  1. Open each HTML file where you want the button.
  2. Paste the installation code into the desired position inside <body>.
  3. Save and upload the updated files.
  4. Check each published page to confirm the placement.

For more detailed instructions, check our Help Center guide. If you still need help, our support team can help you install the widget on your website.

Do I need special hosting to use the PayPal Button on HTML?

No. Standard static hosting is enough, provided your pages allow the widget’s JavaScript to load and run.

Can I add the PayPal Button to a static HTML website?

Yes. Paste the complete installation code into your HTML file, save it, and upload the updated file to your server.

Where do I paste the code on my HTML page?

Insert it inside the page’s <body>, where you want the button to appear—for example, beside a product description or in a footer or sidebar.

Do I have to code a PayPal button in HTML myself?

No. Configure the button in the Elfsight editor, then copy and paste the generated installation code into your page.

Does my HTML website need to support JavaScript?

Yes. The installation code uses JavaScript to load the widget, so the page must allow that script to run.

What types of payments can I accept with the PayPal Button?

You can configure one-time purchases, subscriptions, or donations. For subscriptions, choose a billing interval and enable recurring payments if needed.

Can I include tax and shipping in the payment total?

Yes. Set shipping as a fixed amount and tax as either a fixed amount or a percentage. These charges are added to the price at PayPal checkout.

How can I customize the PayPal button?

Adjust its width, size, shape, border, and colors. You can also edit the button text and choose which PayPal branding elements appear.

Can I show card icons next to the button?

Yes. Choose which payment icons to display, including Visa, Mastercard, American Express, and Discover. These are visual indicators; enabling an icon does not activate a payment method.

Does the PayPal Button support multiple currencies?

Yes. Choose a supported currency in the editor. The selected currency also applies to shipping and fixed tax amounts.

Can I redirect buyers after payment?

Yes. Set a Redirect URL to direct buyers to a page of your choice, such as a thank-you page, after a successful transaction.

Can I accept donations with the PayPal Button?

Yes. Choose the Donation payment type and specify either a fixed donation amount or an amount chosen by the donor.

Can donors enter their own contribution amount?

Yes. Select Optional as the donation type to let donors choose how much to contribute.

Can I build the button for free?

Yes. Elfsight offers a Free plan which lets you create and customize your PayPal button and add it to your website for free.

Pricing

14-day money back guarantee. Risk-free, you can cancel at anytime.
Elfsight Apps
Multi-platform version that suits for any website
from $0 / month
start with free plan
Unlimited domains
Fast company support and well documented
Free installation help
Special price for multiple apps
Editable content
Black Friday Sale
50% OFF
+1 FREE MONTH
The Biggest Sale of the Year. Don't Miss Out!
Grab The Deal