Tariff rate, applied, simple mean, all products (%)

Source: worldbank.org, 03.09.2025

Year: 2022

Flag Country Value Value change, % Rank
Angola Angola 11.6 -3.66% 35
Albania Albania 0.57 -64.6% 107
Argentina Argentina 12 +0.42% 32
Australia Australia 2.01 +4.15% 95
Austria Austria 1.95 -12.9% 97
Azerbaijan Azerbaijan 8.89 -4% 54
Burundi Burundi 12.6 +11.9% 28
Belgium Belgium 1.95 -12.9% 97
Benin Benin 11.3 -0.177% 39
Burkina Faso Burkina Faso 11.4 +0.971% 38
Bangladesh Bangladesh 12.9 +2.55% 22
Bulgaria Bulgaria 1.95 -12.9% 97
Bahrain Bahrain 3.65 +1.39% 79
Bahamas Bahamas 26.3 +11.2% 1
Bosnia & Herzegovina Bosnia & Herzegovina 3.39 +7.28% 81
Belize Belize 12 +1.26% 31
Bermuda Bermuda 22.3 +0.225% 2
Bolivia Bolivia 9.83 0% 49
Brazil Brazil 13.3 +0.682% 17
Barbados Barbados 11.9 +24.6% 34
Brunei Brunei 0.18 +50% 109
Bhutan Bhutan 6.77 +66.7% 62
Botswana Botswana 8.25 +5.91% 57
Central African Republic Central African Republic 19.3 +21% 4
Canada Canada 1.83 -11.2% 100
Switzerland Switzerland 3.16 -23.5% 83
Chile Chile 1.03 -3.74% 106
China China 5.36 +0.942% 69
Côte d’Ivoire Côte d’Ivoire 12.7 +4.86% 27
Cameroon Cameroon 18.9 +1.56% 6
Congo - Brazzaville Congo - Brazzaville 19.2 +48.7% 5
Colombia Colombia 3.55 +11.3% 80
Cape Verde Cape Verde 14.3 +5.3% 11
Costa Rica Costa Rica 2.63 -5.05% 89
Cuba Cuba 10.6 +1.53% 43
Cyprus Cyprus 1.95 -12.9% 97
Czechia Czechia 1.95 -12.9% 97
Germany Germany 1.95 -12.9% 97
Denmark Denmark 1.95 -12.9% 97
Dominican Republic Dominican Republic 4.48 -19% 74
Algeria Algeria 11.2 -12.7% 40
Ecuador Ecuador 7.82 +1.56% 58
Spain Spain 1.95 -12.9% 97
Estonia Estonia 1.95 -12.9% 97
Finland Finland 1.95 -12.9% 97
France France 1.95 -12.9% 97
Gabon Gabon 18.8 +0.965% 7
United Kingdom United Kingdom 1.13 +13% 103
Georgia Georgia 0.4 -6.98% 108
Ghana Ghana 13 +0.935% 18
Guinea Guinea 12.9 -1.83% 21
Gambia Gambia 14 -0.357% 12
Guinea-Bissau Guinea-Bissau 13.6 +2.42% 16
Equatorial Guinea Equatorial Guinea 20 +7.08% 3
Greece Greece 1.95 -12.9% 97
Grenada Grenada 12.9 +22.5% 19
Guatemala Guatemala 3.12 +4% 84
Guyana Guyana 9.16 -1.29% 52
Hong Kong SAR China Hong Kong SAR China 0 111
Honduras Honduras 1.63 -51.5% 101
Croatia Croatia 1.95 -12.9% 97
Hungary Hungary 1.95 -12.9% 97
Indonesia Indonesia 5.82 -3.32% 65
India India 10.1 +2.03% 44
Ireland Ireland 1.95 -12.9% 97
Iceland Iceland 1.32 -13.7% 102
Israel Israel 3.16 -2.17% 83
Italy Italy 1.95 -12.9% 97
Jamaica Jamaica 9.72 +8.6% 51
Jordan Jordan 5.59 +6.88% 67
Japan Japan 1.99 -8.72% 96
Kazakhstan Kazakhstan 4.75 +6.03% 71
Kenya Kenya 15.8 +12.1% 9
Cambodia Cambodia 12.3 +59.5% 29
South Korea South Korea 5.73 +14.6% 66
Kuwait Kuwait 4.64 +20.2% 73
Laos Laos 2.49 0% 91
Liberia Liberia 13.6 -3.48% 15
Lesotho Lesotho 4.19 -30.3% 75
Lithuania Lithuania 1.95 -12.9% 97
Latvia Latvia 1.95 -12.9% 97
Macao SAR China Macao SAR China 0 111
Moldova Moldova 2.37 +1.28% 92
Madagascar Madagascar 10 +17.6% 45
Maldives Maldives 9.73 -6.71% 50
Mexico Mexico 2.69 -18% 88
North Macedonia North Macedonia 3.65 +5.49% 79
Mali Mali 12.2 +6.91% 30
Malta Malta 1.95 -12.9% 97
Myanmar (Burma) Myanmar (Burma) 2.98 -2.93% 86
Montenegro Montenegro 1.88 -4.57% 99
Mongolia Mongolia 5.04 0% 70
Mauritania Mauritania 12.9 +3.03% 20
Mauritius Mauritius 1.07 -7.76% 105
Malaysia Malaysia 5.43 -3.21% 68
Namibia Namibia 7.09 +5.35% 61
Niger Niger 10.7 +2.48% 42
Nigeria Nigeria 11.9 -6.3% 33
Nicaragua Nicaragua 2.98 -1.97% 86
Netherlands Netherlands 1.95 -12.9% 97
Norway Norway 2.57 -26.4% 90
Nepal Nepal 13.6 +4.12% 13
New Zealand New Zealand 2.27 +18.8% 93
Oman Oman 3.18 +1.92% 82
Pakistan Pakistan 11 -5.84% 41
Panama Panama 5.93 -1% 64
Peru Peru 1.1 +1.85% 104
Philippines Philippines 3.94 -1.75% 77
Poland Poland 1.95 -12.9% 97
Portugal Portugal 1.95 -12.9% 97
Paraguay Paraguay 8.27 +1.97% 55
Qatar Qatar 3.98 +0.759% 76
Romania Romania 1.95 -12.9% 97
Rwanda Rwanda 11.9 -0.252% 34
Saudi Arabia Saudi Arabia 5.96 +26.8% 63
Senegal Senegal 12.8 -1.01% 25
Singapore Singapore 0.05 -37.5% 110
Solomon Islands Solomon Islands 11.9 +17.7% 33
Sierra Leone Sierra Leone 13.6 -0.946% 14
El Salvador El Salvador 3.09 -5.79% 85
Suriname Suriname 9.91 -2.36% 46
Slovakia Slovakia 1.95 -12.9% 97
Slovenia Slovenia 1.95 -12.9% 97
Sweden Sweden 1.95 -12.9% 97
Eswatini Eswatini 4.74 -34% 72
Seychelles Seychelles 1.91 +9.14% 98
Chad Chad 18.6 +2.15% 8
Togo Togo 12.9 +13.4% 23
Thailand Thailand 8.26 -2.59% 56
Tonga Tonga 9.84 +3.25% 48
Trinidad & Tobago Trinidad & Tobago 9.02 -13.4% 53
Turkey Turkey 7.48 +68.5% 59
Tanzania Tanzania 12.8 +6.07% 24
Uganda Uganda 15.1 +3.14% 10
Ukraine Ukraine 2.09 -3.24% 94
Uruguay Uruguay 9.9 +0.202% 47
United States United States 2.72 -2.51% 87
St. Vincent & Grenadines St. Vincent & Grenadines 9.72 -0.613% 51
Venezuela Venezuela 12.7 -2.38% 26
Vietnam Vietnam 3.71 -12.1% 78
Vanuatu Vanuatu 11.5 +5.81% 37
South Africa South Africa 7.31 +2.09% 60
Zambia Zambia 11.5 -1.37% 36

                    
# Install missing packages
import sys
import subprocess

def install(package):
subprocess.check_call([sys.executable, "-m", "pip", "install", package])

# Required packages
for package in ['wbdata', 'country_converter']:
try:
__import__(package)
except ImportError:
install(package)

# Import libraries
import wbdata
import country_converter as coco
from datetime import datetime

# Define World Bank indicator code
dataset_code = 'TM.TAX.MRCH.SM.AR.ZS'

# Download data from World Bank API
data = wbdata.get_dataframe({dataset_code: 'value'},
date=(datetime(1960, 1, 1), datetime.today()),
parse_dates=True,
keep_levels=True).reset_index()

# Extract year
data['year'] = data['date'].dt.year

# Convert country names to ISO codes using country_converter
cc = coco.CountryConverter()
data['iso2c'] = cc.convert(names=data['country'], to='ISO2', not_found=None)
data['iso3c'] = cc.convert(names=data['country'], to='ISO3', not_found=None)

# Filter out rows where ISO codes could not be matched — likely not real countries
data = data[data['iso2c'].notna() & data['iso3c'].notna()]

# Sort for calculation
data = data.sort_values(['iso3c', 'year'])

# Calculate YoY absolute and percent change
data['value_change'] = data.groupby('iso3c')['value'].diff()
data['value_change_percent'] = data.groupby('iso3c')['value'].pct_change() * 100

# Calculate ranks (higher GDP per capita = better rank)
data['rank'] = data.groupby('year')['value'].rank(ascending=False, method='dense')

# Calculate rank change from previous year
data['rank_change'] = data.groupby('iso3c')['rank'].diff()

# Select desired columns
final_df = data[['country', 'iso2c', 'iso3c', 'year', 'value',
'value_change', 'value_change_percent', 'rank', 'rank_change']].copy()

# Optional: Add labels as metadata (could be useful for export or UI)
column_labels = {
'country': 'Country name',
'iso2c': 'ISO 2-letter country code',
'iso3c': 'ISO 3-letter country code',
'year': 'Year',
'value': 'GDP per capita (current US$)',
'value_change': 'Year-over-Year change in value',
'value_change_percent': 'Year-over-Year percent change in value',
'rank': 'Country rank by GDP per capita (higher = richer)',
'rank_change': 'Change in rank from previous year'
}

# Display first few rows
print(final_df.head(10))

# Optional: Save to CSV
#final_df.to_csv("gdp_per_capita_cleaned.csv", index=False)
                    
                
                    
# Check and install required packages
required_packages <- c("WDI", "countrycode", "dplyr")

for (pkg in required_packages) {
  if (!requireNamespace(pkg, quietly = TRUE)) {
    install.packages(pkg)
  }
}

# Load the necessary libraries
library(WDI)
library(dplyr)
library(countrycode)

# Define the dataset code (World Bank indicator code)
dataset_code <- 'TM.TAX.MRCH.SM.AR.ZS'

# Download data using WDI package
dat <- WDI(indicator = dataset_code)

# Filter only countries using 'is_country' from countrycode
# This uses iso2c to identify whether the entry is a recognized country
dat <- dat %>%
  filter(countrycode(iso2c, origin = 'iso2c', destination = 'country.name', warn = FALSE) %in%
           countrycode::codelist$country.name.en)

# Ensure dataset is ordered by country and year
dat <- dat %>%
  arrange(iso3c, year)

# Rename the dataset_code column to "value" for easier manipulation
dat <- dat %>%
  rename(value = !!dataset_code)

# Calculate year-over-year (YoY) change and percentage change
dat <- dat %>%
  group_by(iso3c) %>%
  mutate(
    value_change = value - lag(value),                              # Absolute change from previous year
    value_change_percent = 100 * (value - lag(value)) / lag(value) # Percent change from previous year
  ) %>%
  ungroup()

# Calculate rank by year (higher value => higher rank)
dat <- dat %>%
  group_by(year) %>%
  mutate(rank = dense_rank(desc(value))) %>% # Rank countries by descending value
  ungroup()

# Calculate rank change (positive = moved up, negative = moved down)
dat <- dat %>%
  group_by(iso3c) %>%
  mutate(rank_change = rank - lag(rank)) %>% # Change in rank compared to previous year
  ungroup()

# Select and reorder final columns
final_data <- dat %>%
  select(
    country,
    iso2c,
    iso3c,
    year,
    value,
    value_change,
    value_change_percent,
    rank,
    rank_change
  )

# Add labels (variable descriptions)
attr(final_data$country, "label") <- "Country name"
attr(final_data$iso2c, "label") <- "ISO 2-letter country code"
attr(final_data$iso3c, "label") <- "ISO 3-letter country code"
attr(final_data$year, "label") <- "Year"
attr(final_data$value, "label") <- "GDP per capita (current US$)"
attr(final_data$value_change, "label") <- "Year-over-Year change in value"
attr(final_data$value_change_percent, "label") <- "Year-over-Year percent change in value"
attr(final_data$rank, "label") <- "Country rank by GDP per capita (higher = richer)"
attr(final_data$rank_change, "label") <- "Change in rank from previous year"

# Print the first few rows of the final dataset
print(head(final_data, 10))