// Library deep-dive

Turn.js

The classic jQuery page-flip plugin that defined the look-and-feel of HTML5 flipbooks.

★ 7,475 on GitHub NOASSERTION JavaScript Since 2012 Best for: Digital Magazines

What Turn.js is, in one paragraph

Turn.js is an open-source flipbook library aimed at the Digital Magazines segment of the digital-publishing market. It currently sits at 7,475 GitHub stars and is licensed under NOASSERTION, which means you can fork, vendor, and ship it inside commercial projects without the licensing complexity of a hosted SaaS. The library’s primary language is JavaScript, and it has been actively used in production since at least 2012. Teams reach for Turn.js when they need real control over the page-flip experience, the kind of control that hosted viewers like Issuu or Calaméo cannot give you because their viewers live behind an iframe you do not own.

The reason Turn.js shows up so frequently in shortlists is that it solves the actual hard problem of building a flipbook on the web: convincing a browser to render a believable book-curl with low-jank frame timing across desktop and mobile, while still letting you put real, indexable content underneath. related performance considerations are worth reviewing before you commit, because the rendering strategy a library picks (DOM transforms vs Canvas vs WebGL) determines how it scales as your page count grows past 50, 100, or 500 pages.

Browser & platform support

Chrome 16+, Firefox 10+, Safari 5+, Edge, IE10+ (with shims). Mobile Safari/Android Chrome supported via touch shim.

If your audience skews toward older Android devices, embedded browsers (in-app webviews on iOS and Android), or corporate IE/Edge-Legacy fleets, run a real device test before committing, the documented support matrix is the floor, not a guarantee. We have also seen flipbook libraries behave very differently when loaded inside a parent iframe, behind aggressive corporate proxies, or under restrictive Content Security Policies, so set up a representative staging environment before you finalise the choice.

Feature matrix

FeatureSupported
Responsive sizing Yes
Touch / swipe gestures Yes
Page-turn sound effects No
Page zoom Yes
Thumbnail navigation No
Hardware-accelerated transforms Yes
Pinch-to-zoom on mobile No
Right-to-left page order Yes

The matrix above is opinionated. “Supported” means the feature ships in the library’s public API or is documented as a built-in option, not that you can build it on top with enough custom code. Most flipbook libraries can be extended to support every cell in this table, but the further you stray from the supported list, the more friction you incur and the more brittle your viewer becomes when the library publishes its next minor version.

Install

<script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
<script src="turn.min.js"></script>

Code sample

The minimum working example for Turn.js looks like this. It is intentionally close to what you would paste into a fresh project just to see the page-flip animation work, before customising shadows, gestures, and analytics:

<div id="magazine">
  <div class="page"><img src="page-1.jpg"></div>
  <div class="page"><img src="page-2.jpg"></div>
  <div class="page"><img src="page-3.jpg"></div>
  <div class="page"><img src="page-4.jpg"></div>
</div>

<script>
$('#magazine').turn({
  width: 800,
  height: 600,
  autoCenter: true,
  display: 'double',
  acceleration: true,
  gradients: true,
  elevation: 50,
  when: {
    turning: function(e, page) {
      console.log('Turning to page', page);
    }
  }
});
</script>

From there, the typical hardening steps are: load page assets lazily, attach analytics events to the library’s page-change callback, deep-link the current page to a URL hash so readers can share specific spreads, and add a print stylesheet so power-users can export PDF copies. The tutorials index walks through each of those workflows.

Ideal use case

Turn.js is the right pick when you are building Digital Magazines-style content. That is not just a marketing label, it shapes which features matter. For a digital magazines, the audience is typically sitting on a phone or tablet, scrolling for entertainment, expecting a magazine-like reading rhythm with sharp typography and full-bleed photography. Pick a library that matches the rhythm of that audience, not the one with the most stars.

How Turn.js stacks up against alternatives

The alternatives below are libraries that solve the same core problem but from a different angle. We maintain a dedicated comparison index for the most common head-to-heads:

StPageFlip

Modern, dependency-free TypeScript page-flip library with realistic shadows and gradients.

★ 807 MIT

BookBlock

A Codrops content-flip plugin with portrait and landscape modes, perfect for editorial layouts.

★ 983 MIT

PageFlip.js

Modern ESM page-flip library (the npm-packaged distribution of StPageFlip).

★ 807 MIT

If you have time for only one comparison, start with Turn.js vs StPageFlip vs BookBlock, it is the foundational decision most teams make before drilling into framework wrappers or PDF-first viewers. our verdict on each library changes year-to-year as upstream repos evolve.

Use Turn.js for a specific use case

Each link below opens a 300-word working recipe: setup, the use-case-specific patterns that matter, the mistake to avoid, and the alternatives worth knowing.

Where to go next