Homeostatic synaptic scaling is thought to occur cell-wide, but recent evidence suggests this form of stabilizing plasticity can be implemented more locally in reduced preparations. To investigate the spatial scales of plasticity in vivo, we used repeated two-photon imaging in mouse visual cortex after sensory deprivation to measure TNF-α dependent increases in spine size as a proxy for synaptic scaling in vivo in both excitatory and inhibitory neurons. We found that after sensory deprivation, increases in spine size are restricted to a subset of dendritic branches, which we confirmed using immunohistochemistry. We found that the dendritic branches that had individual spines that increased in size following deprivation, also underwent a decrease in spine density. Within a given dendritic branch, the degree of spine size increases is proportional to recent spine loss within that branch. Using computational simulations, we show that this compartmentalized form of synaptic scaling better retained the previously established input-output relationship in the cell, while restoring activity levels. We then investigated the relationship between new spines that form after this spine loss and strengthening and find that their spatial positioning facilitates strengthening of maintained synapses.