The emergence of Decentralized Energy Resources (DERs) and rising electricity demand are known to cause grid instability. Additionally, recent policy developments indicate a decreased tariff in the future for electricity sold to the grid by households with DERs. Energy Storage Systems (ESS) combined with Demand Side Management (DSM) can improve the self-consumption of Photovoltaic (PV) generated electricity and decrease grid imbalance b. The emergence of Decentralized Energy Resources (DERs) and rising electricity demand are known to cause grid instability. Additionally, recent policy developments indicate a decreased tariff in the future for electricity sold to the grid by households with DERs. Energy Storage Systems (ESS) combined with Demand Side Management (DSM) can improve the self-consumption of Photovoltaic (PV) generated electricity and decrease grid imbalance between supply and demand. Household Energy Storage (HES) and Community Energy Storage (CES) are two promising storage scenarios for residential electricity prosumers. This paper aims to assess and compare the technical and economic feasibility of both HES and CES. To do that, mathematical optimization is used in both scenarios, where a Home Energy Management System (HEMS) schedules the allocation of energy from the PV system, battery and the grid in order to satisfy the power demand of households using a dynamic pricing scheme. The problem is formulated as a Mixed Integer Linear Programming (MILP) with the objective of minimizing the costs of power received from the grid. Data from real demand and PV generation profiles of 39 households in a pilot project initiated by the Distribution System Operator (DSO) 'Enexis' in Breda, the Netherlands, is used for the numerical analysis. Results show that the self consumption of PV power is the largest contributor to the savings obtained when using ESS. The implementation of different ESS reduces annu. ••Modelling and optimization of HES and CES for prosumers with smart appliances.••Economic feasibility of both HES and CES using real data of 39 households in a pilot project.••Sensitivity analysis considering different sizes and prices of storage systems.••PV self-consumption has a large impact on annual saving achieved by storage and influences the PBP.••Self-consumptionEnergy management systemsDemand side managementPhotovoltaicEnergy storage systemsMixed integer linear programmingAbbreviationsCES community energy storageDER decentralized energy resourceDSM demand side managementDSO distribution system operatorEMS energy management systemESS energy storage systemsHEMS home energy management systemHES household energy storageLCOE levelized cost of energyMILP mixed integer linear programmingPBP pay back periodPHEV plug-in hybrid electric vehiclePV photovoltaicRES renewable energy sourcesRTP real time pricingS1PW1 scenario1: HES with Powerwall 1S1PW2 scenario1: HES with Powerwall 2S2CES scenario2: CES with current operating sizeS2CESopt scenario2: CES with optimal sizeSoC state of chargeWM washing machineIndicesa index for shiftable appliances, a∈{1,2,. ,A}i index for households, i∈{1,2,. ,N}t index for time-slots, t∈{1,2,. ,T}SetsAi number. Over the last couple of decades, global power demand has increased significantly across all sectors. In the residential sector, electrification is an important contributor to the increasing power demand. At the same time, both European and Dutch national policy dictate that efforts should be made to reduce carbon emissions and increase the share of renewable energy in order to counter climate change,. This has led to the rapid development and application of renewable energy technologies. In the residential sector, this trend has manifested itself by a sharp increase of Photovoltaic (PV) systems on residential rooftops.The intermittent nature of Decentralized Energy Resources (DERs), combined with the rising electricity demand causes difficulties for the grid operator in maintaining the grid's reliability and stability. The peak demand of electricity usually occurs at a different interval from the supply peak provided by DERs, creating a mismatch between renewable generation profiles and demand profiles. Demand Side Management (DSM) is one of the concepts used to optimize the matching between power supply and demand. DSM is defined as 'actions that influence the way consumers use electricity in order to achieve savings and higher efficiency in energy use'. DSM can be used to optimize self-consumption levels of DERs, thereby decreasing the need for energy tran.