css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

              <div class="welcome-tax-calculator">
  <label class="value">
    Valeur du bien* / Property Value*
    <input type="number" id="value" />

  <p class="result-line">
    Total fees:
    <span id="fees" class="fees">0</span>
<div class="sources">
<blockquote class="tax-source">
<p>*La base d'imposition correspond au montant le plus élevé parmi les trois montants suivants :</p>
<li>Le montant réellement payé pour le transfert de l'immeuble (n'incluant pas la TPS et la TVQ)</li>
<li>Le montant de la contrepartie stipulé pour le transfert de l'immeuble (généralement, il s'agit du montant inscrit dans l'acte de vente)</li>
<li>Le montant de la valeur marchande au moment du transfert de l'immeuble (valeur inscrite au rôle d'évaluation multipliée par le facteur comparatif de l'exercice correspondant à la date de transfert).</li>

<blockquote class="tax-source">
<p>*The basis of imposition corresponds to the greater of the following three amounts:</p>

<li>The amount that was actually paid for the transfer of the immovable (not including the GST and the QST)</li>
<li>The amount of the consideration stipulated for the transfer of the immovable (generally the amount shown on the deed of sale)</li>
<li>The amount of the market value at the time of the transfer of the immovable (value entered on the property assessment roll multiplied by the comparative factor of the transfer's fiscal year).</li>
              body {
  font-family: sans-serif;
.welcome-tax-calculator {
  border: 1px solid #eee;
  padding: 20px;
  margin: 15px 0;
  width: 50%;
  float: left;
  text-align: center;
  box-sizing: border-box;
.value {
  font-weight: bold;
.value input {
  display: block;
  width: 200px;
  padding: 10px;
  font-size: 18px;
  margin: 10px auto;
.result-line {
  font-weight: bold;
.fees {
  font-weight: bolder;
  color: #cb2027;
  font-size: 20px;
.sources {
  float: right;
  width: 50%;
.tax-source {
  background-color: #fafafa;
  border-left: 5px solid #f48fb1;
  padding: 10px 20px;
  font-style: italic;
Droits sur les mutations immobilières (Montréal)
French: http://ville.montreal.qc.ca/portal/page?_pageid=43,60524&_dad=portal&_schema=PORTAL

Duties on transfers of immovables (Montreal)
English: http://ville.montreal.qc.ca/portal/page?_pageid=44,80257&_dad=portal&_schema=PORTAL

Updated: Nov 2017

var input = document.getElementById( 'value' );
var fees = document.getElementById( 'fees' );

function welcometax( value ) {
	var inrange;
	var result = 0;
  var remaining = value;
	var parts = new Array();
	parts.push([50000, 0.005]);
	parts.push([250000, 0.01]);
	parts.push([500000, 0.015]);
	parts.push([1000000, 0.02]);

	for ( var i = 0; i < 4; i++ ) {
		if ( value >= parts[i][0] ) {
      var prev = ( i >= 1 ) ? i - 1 : false;
      var prevRange = ( i >= 1 ) ? parts[prev][0] : 0;
			inrange = parts[i][0] - prevRange;
			result += inrange * parts[i][1];
      remaining = remaining - inrange;
		} else if ( value < parts[i][0] ) {
			result += remaining * parts[i][1];
      remaining = 0;
	if ( remaining > 0 ) {
		result += remaining * 0.025;

	return Math.round( result, 2 );

input.addEventListener('input', function() {
  var result = welcometax( input.value );
  fees.innerHTML = result;
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................